Tom Rathborne wrote:
> ---BEGIN---
>
> use Win32::API;
> $library = "KrugerCall.dll";
The docs imply you don't need the '.dll' ending.
> $functionname = "FanSelFnName";
> @argumenttypes =
> ("P","I","I","I","I","I","I","I","I","I","I","I","P");
> $returntype = "P";
> $lpPoint = pack("III", 1, 2,3); # store options...
>
> @arguments =
> ('FDA','1.5','200','1','2.5','300','600','900','1','0','40',
> '0',$lpPoint);
The docs say: "for pointers you must use a variable name (no reference, just
a plain variable name)". So you can't use 'FDA' here for the first 'P'
argument; you have to put 'FDA' into a variable and pass that variable to
$func->Call(). And '1.5' and '2.5' don't look much like integers to me (come
to think of it, neither do the values -- they look like strings). Try this:
$fda = 'FDA';
@arguments = ($fda, 1, 200, 1, 2, 300, 600, 900, 1, 0, 40, 0, $lpPoint);
What's the C prototype for the function you want to call?
>
> $func = new Win32::API($library, $functionname, \@argumenttypes,
> $returntype); // This is okay...
The docs say: "Before you can call it, you should test that [the function]
is defined, otherwise either the function or the library has not been
found." So add something along the lines of: die "Can't get handle for
$functionname!" unless defined $func;
> $return = $func->Call(@arguments); // This causes the runtime
> exception - but partially executes...
>
> print $return;
>
> ---END---
>
> "KrugerCall.dll" is a DLL which expects the number of
> arguments (above) to be sent to it, and then throws some
> more data back again. Any ideas why I am getting this
> error?
No. Please give more information (including the C prototype for the DLL
function).
And if the error is in the DLL, include its source code :-).
Cheers,
Philip
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]