celoftis
9/10/2007 11:57:00 PM
On Sep 7, 10:53 am, "Armin Zingler" <az.nos...@freenet.de> wrote:
>>
> I don't see an error in the code using SetNotificationPositions. Using
> managed DX, you can use
> Microsoft.DirectX.DirectSound.Notify.SetNotificationPositions. Maybe you can
> migrate to MDX.
>
> ....... I did some debugging with your code. Using unmanaged debugging, it
> turns out to be an interop marshalling problem, as the callstack shows:
>
> > mscorlib.dll!System.Runtime.InteropServices.SafeArrayTypeMismatchException.SafeArrayTypeMismatchException()
>
> mscorwks.dll!_CallDescrWorker@16()
> mscorwks.dll!MethodDesc::CallDescr()
> mscorwks.dll!MethodDesc::Call()
> mscorwks.dll!CallDefaultConstructor()
> mscorwks.dll!CreateMethodExceptionObject()
> mscorwks.dll!RealCOMPlusThrow()
> mscorwks.dll!OleVariant::CreateSafeArrayForArrayRef()
> mscorwks.dll!SafeArrayMarshaler::ConvertSpaceComToNative()
> mscorwks.dll!SafeArrayMarshaler::MarshalComToNativeByref()
> mscorwks.dll!RunML()
> WindowsApplication28.exe!WindowsApplication28.Form1.Initialize(...) Basic
>
> So, it's actually a "SafeArrayTypeMismatchException". Unfortunatelly, I have
> no clue, why. But maybe somebody else can use this information to help
> (Mattias? :-) ) Or you can try the interop group
> (microsoft.public.dotnet.framework.interop).
>
> After manually importing the tlb, enabling "load dll exports" and changing
> the IDE's exception handling to jump into the debugger when the exception is
> raised for all types of exceptions, the call stack is:
>
> kernel32.dll!_RaiseException@16()
> mscorwks.dll!RaiseTheException()
> mscorwks.dll!RealCOMPlusThrow()
> mscorwks.dll!RealCOMPlusThrow()
> mscorwks.dll!CreateMethodExceptionObject()
> mscorwks.dll!RealCOMPlusThrowHRWorker()
> mscorwks.dll!RealCOMPlusThrowHRWorker()
> mscorwks.dll!RealCOMPlusThrowHR()
> mscorwks.dll!RealCOMPlusThrowHR()
> mscorwks.dll!OleVariant::CreateSafeArrayDescriptorForArrayRef()
> mscorwks.dll!OleVariant::CreateSafeArrayForArrayRef()
> mscorwks.dll!SafeArrayMarshaler::ConvertSpaceComToNative()
> mscorwks.dll!SafeArrayMarshaler::MarshalComToNativeByref()
> mscorwks.dll!RunML()
>
> > WindowsApplication28.exe!WindowsApplication28.Form1.Initialize(...) Basic
>
> Hmmm...