|
Posted by Sisyphus on July 30, 2005, 11:20 pm
Please log in for more thread options
> 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
|