Click here to get back home

strings and numbers

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
strings and numbers les_andrey 07-30-2005
Posted by les_andrey on July 30, 2005, 2:28 am
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

Thanks,
Andrew



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





Posted by Andrew on July 31, 2005, 1:46 pm
Please log in for more thread options


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



Posted by Sisyphus on August 1, 2005, 9:27 am
Please log in for more thread options



> 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




Similar ThreadsPosted
strings and numbers July 30, 2005, 2:27 am
Extracting strings delimited by other strings May 7, 2005, 11:54 am
Will XML::Simple work with keys, strings, integers, and dates? March 21, 2005, 10:43 am
xs typemap for &subr(@numbers) ? January 6, 2005, 11:17 am
converting phone numbers to alphabets July 7, 2004, 6:49 pm
need translators for Lingua::Slavic::Numbers July 29, 2008, 10:52 am
Modules/code for comparing version numbers? September 15, 2004, 1:55 pm
Print Subject without characters Just Numbers using POP3Client. Please Help April 10, 2007, 11:27 pm
[ANNOUNCE] Test::Float -- compare numbers to specified precision December 26, 2004, 4:20 pm
How to print just numbers includes in Subject using POP3Client Module. April 9, 2007, 9:18 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap