Hi,
I'm trying to play an AVI file from memory with MCI. The documentation is
great
if you want to play a file from a file but directly from memory... almost
nothing.
After hours of searching I found this:
http://support.microsoft.com/kb/q155360/
and after that:
http://binaryworld.net/Main/CodeDetail.aspx?CodeId=3780
Which describes how to do what I want... the problem is that the first code
is in C++ and the second in VB.
For the past few hours I've been trying to translate this into C# but
without any luck. This is what I have so far:
public const long MMIO_INSTALLPRO C = 0x10000;
public const long MMIO_GLOBALPROC = 0x10000000;
public const long MEY = 0x2059454D;
[DllImport("winm m.dll")]
private static extern long mmioInstallIOPr oc(long fccIOProc,
MulticastDelega te pIOProc, long dwFlags);
long retVal = mmioInstallIOPr oc(MEY, new CallbackDelegat e(IOProc),
MMIO_INSTALLPRO C | MMIO_GLOBALPROC );
private long IOProc(ref MMIOINFO lpMMIOInfo, long uMessage, IntPtr lParam1,
IntPtr lParam2)
{
.....
}
// NOTE1: I found the definition of MMIOINFO on the second link
Everytime I try calling mmioInstallIOPr oc I get this warning:
"A call to PInvoke function 'Media!MMedia.M edia::mmioInsta llIOProc' has
unbalanced the stack. This is likely because the managed PInvoke signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature."
I continue execution and see that the movie isn't loaded...
Could someone PLEASE help me with correct "translatio ns" of these methods?
Thank you,
sačo