Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Win32::API passing a parameter by reference issue

by rpnoble419 (Pilgrim)
on Jun 22, 2008 at 12:36 UTC ( #693365=note: print w/ replies, xml ) Need Help??


in reply to Re: Win32::API passing a parameter by reference issue
in thread Win32::API passing a parameter by reference issue

My example was not clear. I did try using $wParam as the buffer size as that is what was returned by the message hook from Win32::GUI. That still caused the system to hang on the second pass. It was not until I created the reference to wParam that it worked.


Comment on Re^2: Win32::API passing a parameter by reference issue
Re^3: Win32::API passing a parameter by reference issue
by karamorf (Initiate) on Oct 17, 2008 at 18:04 UTC

    I was experiencing this same issue of the function call only happening once and then the next time the script would just end. Though it looks like we might have been experiencing it for different reasons figured I would post my solution since this is the first google result I got, maybe someone else will find it helpful :)

    Anywise, I was defining my function like this:

    my $getIndivPages = new Win32::API('c:\WINNT\system32\ALISE_Domain_nav.dll', 'GetPageNum', 'PPPP', 'N');

    And it work work the first time I did $getInivPages->Call(...), however I had this in a loop to be executed n times and it would only be executed once. So after much frustration I tried a random thing and redefined my function like this:

    my $getIndivPages = Win32::API->new('c:\WINNT\system32\ALISE_Domain_nav.dll', 'void __stdcall GetPageNum(long num, char *con, char *tit, char *url)');

    And it worked! (though I couldn't believe that's what was wrong after wasting many hours), anywise going through the loop the function would be executed the intended amount of times. Seems weird for it to be able to work just by changing how the function is defined but whatever.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://693365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-07-13 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (248 votes), past polls