in reply to Win32::API syntax for mciSendCommand?

Well, the function is described at MSDN like this:
MCIERROR mciSendCommand(
    MCIDEVICEID IDDevice,
    UINT uMsg,
    DWORD_PTR fdwCommand,
    DWORD_PTR dwParam
);
So, naively choosing "long" ("N") for each parameter without looking at the headers to see exactly what things like "MCIDEVICEID" means, I would do something like this:
Win32::API->Import("winmm", "mciSendCommand", "NNNN", "N") or die $^E; my $result = mciSendCommand($qux, $quux, $quuux, $quuuux);
If you don't want to import the function into the current namespace, use my $coderef = Win32::API->new("winmm", "mciSendCommand", ...); instead and call like $coderef->(args).

Now, on my Vista 64-bit system, importing that function works and calling it with all-zero parameters does not result in a crash, so we're on the right track. (Though, those DWORD_PTR arguments may need to be of type "P" -- test and see what works).

Hope that helps.

Replies are listed 'Best First'.
Re^2: Win32::API syntax for mciSendCommand?
by slloyd (Hermit) on Sep 22, 2010 at 22:07 UTC
    Thanks. I will give it a try.
    s/te/ve/