Calling a function from a win32-DLL in perl

T

Tom Gur

Hi,

How can I, within a perl script, call a certain function from a win32
DLL file ?

Thanks,
Tom
 
B

Ben Morrow

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top