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.


In reply to Re: Win32::API syntax for mciSendCommand? by Anonymous Monk
in thread Win32::API syntax for mciSendCommand? by slloyd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.