Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with Win32::API module

Status
Not open for further replies.

leeked

Programmer
Joined
Apr 30, 2007
Messages
2
Location
US
I've seen this question elsewhere and I have been all over Google trying to find a solution but I cannot find one anywhere.

Here is the code:
Code:
#!/usr/bin/perl

use Win32::API;

my $ZP4StartSession = new Win32::API("ZP4", "ZP4StartSession", [N], P) || die Win32::FormatMessage(Win32::GetLastError);

my $LLHandle = $ZP4StartSession->Call($LLHandle) || die Win32::FormatMessage(Win32::GetLastError);

The Call() function causes my command line to lock up.
Any help on why this is happening and/or a solution is greatly appreciated.

Thanks,
Chris
 
Code:
my [COLOR=red]$LLHandle[/color] = $ZP4StartSession->Call([COLOR=red]$LLHandle[/color])

Is it because you're using the same undeclared variable twice here?

Maybe...
Code:
my $LLHandle;
$LLHandle = $ZP4StartSession->Call($LLHandle)

or even use different variable names.

I dunno, random stab in the dark.

-------------
Cuvou.com | The NEW Kirsle.net
 
I realized I posted the wrong code, here it is corrected:

Code:
#!/usr/bin/perl

use Win32::API;

my $lpBuffer = "\0" x 64;

my $ZP4StartSession = new Win32::API("ZP4", "ZP4StartSession", [N], P) || die Win32::FormatMessage(Win32::GetLastError);

my $LLHandle = $ZP4StartSession->Call($lpBuffer) || die Win32::FormatMessage(Win32::GetLastError);
 
I would think these arguments should be quoted:

, '[N]', 'P'

but I have no idea why the Call() function locks up the script.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top