Home > Archive > PERL Miscellaneous > July 2005 > strings and numbers
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
strings and numbers
|
|
| les_andrey@yahoo.com 2005-07-30, 4:00 am |
| Hi,
Please, tell me is it a bug or it works properly:
We have Perl code:
use WIN32::API;
my $ref=Win32::API->new('Test_Dll.dll','TestParamMY','PP','N');
my ($test1,$test2) = ('Test_Dll.dll','TestParamMY');
$test1>10;
print $test1."\n";
$ref->Call( $test1, $test2);
Where TestParamMY (C code):
TEST_DLL_API
PDH_FUNCTION TestParamMY( IN LPCSTR szTest1, IN LPCSTR
szTest2){
printf("%s, %s", szTest1, szTest2);
return 1;
}
output:
Test_Dll.dll, Test_Dll.dll
(null), TestParamMY
Modified:
use WIN32::API;
my $ref=Win32::API->new('Test_Dll.dll','TestParamMY','PP','N');
my ($test1,$test2) = ('Test_Dll.dll','TestParamMY');
#######$test1>10;
print $test1."\n";
$ref->Call( $test1, $test2);
Output:
Test_Dll.dll, Test_Dll.dll
Test_Dll.dll, TestParamMY
Thanks,
Andrew
| |
| Sisyphus 2005-07-30, 9:01 am |
|
<les_andrey@yahoo.com> wrote in message
news:1122715704.097238.67680@g49g2000cwa.googlegroups.com...
> Hi,
>
> Please, tell me is it a bug or it works properly:
>
> We have Perl code:
>
> use WIN32::API;
> my $ref=Win32::API->new('Test_Dll.dll','TestParamMY','PP','N');
> my ($test1,$test2) = ('Test_Dll.dll','TestParamMY');
> $test1>10;
> print $test1."\n";
> $ref->Call( $test1, $test2);
>
> Where TestParamMY (C code):
>
> TEST_DLL_API
> PDH_FUNCTION TestParamMY( IN LPCSTR szTest1, IN LPCSTR
> szTest2){
> printf("%s, %s", szTest1, szTest2);
> return 1;
> }
>
> output:
> Test_Dll.dll, Test_Dll.dll
> (null), TestParamMY
>
> Modified:
>
> use WIN32::API;
> my $ref=Win32::API->new('Test_Dll.dll','TestParamMY','PP','N');
> my ($test1,$test2) = ('Test_Dll.dll','TestParamMY');
> #######$test1>10;
> print $test1."\n";
> $ref->Call( $test1, $test2);
>
> Output:
> Test_Dll.dll, Test_Dll.dll
> Test_Dll.dll, TestParamMY
>
If "bug" or "works properly" are the only 2 choices then I'll vote for
"bug".
Treating the non-numeric string as a number (which seems a silly thing to
do) confuses Win32::API. You could let the author know, and he might fix it
if it's easy to fix. If it's not easy to fix he will probably think "Why
bother ?".
Cheers,
Rob
| |
| Andrew 2005-07-31, 5:17 pm |
| Hi,
Thanks, Rob for your reply, but what could you say if I tell you that I
have the same problem using Lotus Notes through Win32::OLE.
Thanks, a lot.
Andrew
| |
| Sisyphus 2005-07-31, 10:02 pm |
|
"Andrew" <les_andrey@yahoo.com> wrote in message
news:1122842807.017660.207260@z14g2000cwz.googlegroups.com...
> Hi,
>
> Thanks, Rob for your reply, but what could you say if I tell you that I
> have the same problem using Lotus Notes through Win32::OLE.
>
I'm not sure that the 2 problems are connected. Afaik Win32::OLE and
Win32::API work quite differently.
My advice would be to raise this second issue on the perl-win32-users
mailing list (hosted by ActiveState - see
http://aspn.activestate.com/ASPN/Mail/ ). If you do post there, include
"OLE" in the subject line.
You'll find an example that uses Lotus Notes with Win32::OLE in your AS html
documentation at:
/Perl/html/faq/Windows/ActivePerl-Winfaq12.html#use_notes
Does that help ?
Cheers,
Rob
|
|
|
|
|