Re: Calling a function from a win32-DLL in perl
- From: Ben Morrow <ben@xxxxxxxxxxxx>
- Date: Thu, 27 Dec 2007 21:29:46 +0000
Quoth Tom Gur <gur.tom@xxxxxxxxx>:
On Dec 27, 3:20 pm, Kira Yamato <kira...@xxxxxxxxxxxxx> wrote:
On 2007-12-27 07:17:36 -0500, Tom Gur <gur....@xxxxxxxxx> said:
How can I, within a perl script, call a certain function from a win32
DLL file ?
use Win32::API;
IIRC this only works for __stdcall functions, which applies all the
Win32 API functions in e.g. user32.dll, but not to ordinary C functions
exported from DLLs. These can only be called by using XS; the Inline::C
module provides a convenient way to wrap them if you don't want to write
XS, but it requires a C compiler. In principle chromatic's P5NCI ought
to be a good solution, but it doesn't work under Win32 yet.
Is there a way to do it using standard perl modules (without adding
modules) ?
Well, in *principle* you could use Dynaloader directly, but passing the
arguments and retrieving the return value would be well-nigh impossible.
Win32::API is installed with both ActivePerl and Strawberry Perl, so all
Win32 perl installations should include it.
Ben
.
- References:
- Calling a function from a win32-DLL in perl
- From: Tom Gur
- Re: Calling a function from a win32-DLL in perl
- From: Kira Yamato
- Re: Calling a function from a win32-DLL in perl
- From: Tom Gur
- Calling a function from a win32-DLL in perl
- Prev by Date: Regular Expression for XML Parsing
- Next by Date: Re: FAQ 6.4 I put a regular expression into $/ but it didn't work. What's wrong?
- Previous by thread: Re: Calling a function from a win32-DLL in perl
- Next by thread: FAQ 5.2 How do I change, delete, or insert a line in a file, or append to the beginning of a file?
- Index(es):