strings and numbers

Discussion in 'Perl Misc' started by les_andrey@yahoo.com, Jul 30, 2005.

  1. Guest

    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
    , Jul 30, 2005
    #1
    1. Advertising

  2. Sisyphus Guest

    <> wrote in message
    news:...
    > 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
    Sisyphus, Jul 30, 2005
    #2
    1. Advertising

  3. Andrew Guest

    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
    Andrew, Jul 31, 2005
    #3
  4. Sisyphus Guest

    "Andrew" <> wrote in message
    news:...
    > 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
    Sisyphus, Aug 1, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    730
    Malcolm
    Jun 24, 2006
  2. Subra
    Replies:
    25
    Views:
    1,169
    user923005
    Mar 8, 2007
  3. Andrew Tatum

    Fibonacci Numbers and Lucas Numbers

    Andrew Tatum, May 26, 2007, in forum: C++
    Replies:
    6
    Views:
    540
    Howard
    May 27, 2007
  4. Lance Hoffmeyer
    Replies:
    2
    Views:
    511
    Lance Hoffmeyer
    Jul 26, 2007
  5. one man army

    Numbers to strings to numbers again

    one man army, Dec 28, 2005, in forum: Javascript
    Replies:
    6
    Views:
    132
    one man army
    Dec 30, 2005
Loading...

Share This Page