Re: ACM Convert - acmStreamOpen return 512

Tech-Archive recommends: Fix windows errors by optimizing your registry



From: "esselte"

The integer type in VB is a 32bits. I tried to put 32bit
integer every where with no sucess. The error who is
returned by this function is "The specified handle is
invalid." I don't understand why the handle is invalid
because here it is NULL.
I have just seen that acmFormatSuggest and acmStreamOpen
return the same error.

I think your marshalling attributes for the P/Invoke calls
are wrong: the handle should be ByVal (otherwise you get a
IntPtr& a.k.a. HACMDRIVER* instead of an IntPtr a.k.a.
HACMDRIVER) while the wave structures should be ByRef (to
get an LPWAVEFORMATEX).

If you are not familiar with C types and InterOp
marshalling, you may want to take a look at ApiViewer to
help you figure out the correct declaration:

http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.html

Notice that ApiViewer seems to always marshal
pointers/references/result params as Int32, which works on
Win32 but fails on Win64, so you'd better use IntPtr
instead.


--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


.