calling a .dll

L

Larry

How can I do this in Perl:

Declare Function waveInOpen Lib "winmm.dll" (lphWaveIn As Long, ByVal
uDeviceID As Long, lpFormat As WAVEFORMATEX, ByVal dwCallback As Long,
ByVal dwInstance As Long, ByVal dwFlags As Long) As Long

thanks..
 
S

Sisyphus

Larry said:
How can I do this in Perl:

Declare Function waveInOpen Lib "winmm.dll" (lphWaveIn As Long, ByVal
uDeviceID As Long, lpFormat As WAVEFORMATEX, ByVal dwCallback As Long,
ByVal dwInstance As Long, ByVal dwFlags As Long) As Long

Here's 2 ways you can get access to Win32 dll functions from perl:
1) Access the function using the Win32::API module. (That's the most
common way.)

2) Wrap the function using XS or the Inline::C module. For this you'll
need a C compiler.

Cheers,
Rob
 
A

Anno Siegel

Larry said:
How can I do this in Perl:

Declare Function waveInOpen Lib "winmm.dll" (lphWaveIn As Long, ByVal
uDeviceID As Long, lpFormat As WAVEFORMATEX, ByVal dwCallback As Long,
ByVal dwInstance As Long, ByVal dwFlags As Long) As Long

Your question makes no sense. You can't take a snippet of one
language and translate it to another.

Anno
 
L

Larry

Your question makes no sense. You can't take a snippet of one
language and translate it to another.

Anno

my fault. sorry, it was very silly of me.

my aim is get perl to load and use winmm.dll .. that's it

thanks
 
B

Bart Lateur

Larry said:
How can I do this in Perl:

Declare Function waveInOpen Lib "winmm.dll" (lphWaveIn As Long, ByVal
uDeviceID As Long, lpFormat As WAVEFORMATEX, ByVal dwCallback As Long,
ByVal dwInstance As Long, ByVal dwFlags As Long) As Long

My normal answer would be to use Win32::API. "byval ... as long"
translates to "N", the others as "P". Provide scalars with enough room
(assign strings to them) to hold the structures, in particular for
WAVEFORMATEX. Return value type is "N".

However, with a name like "dwCallback", I have doubts it is possible to
do. Well, there is Win32::API::Callback... I've never used it, though.
 

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

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,440
Latest member
YoungBorel

Latest Threads

Top