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_INSTALLPROC = 0x10000;
public const long MMIO_GLOBALPROC = 0x10000000;
public const long MEY = 0x2059454D;
[DllImport("winmm.dll")]
private static extern long mmioInstallIOProc(long fccIOProc,
MulticastDelegate pIOProc, long dwFlags);
long retVal = mmioInstallIOProc(MEY, new CallbackDelegate(IOProc),
MMIO_INSTALLPROC | 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 mmioInstallIOProc I get this warning:
"A call to PInvoke function 'Media!MMedia.Media::mmioInstallIOProc' 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 "translations" of these methods?
Thank you,
sačo