directx bindings problem

evilrat evilrat666 at gmail.com
Tue Oct 29 09:03:59 PDT 2013


On Tuesday, 29 October 2013 at 14:13:40 UTC, Benjamin Thaut wrote:
>
> I also found that for all pp members which take pointers to COM 
> interfaces. For example the "CreateMasteringVoice" 
> "IXAudio2MasteringVoice** ppMasteringVoice" member. In D 
> interfaces are already reference types. So it should read 
> "IXAudio2MasteringVoice* ppMasteringVoice". Then you can also 
> avoid the ugly casting you do in your examples. When fixing 
> this it still doesn't work however.
>
i have removed unneeded ptr-to-ptr in args, still doesn't works. 
but, maybe you can tell something about this code?


//----------------------------
class XACallbacks : ComObject, IXAudio2EngineCallback
{
extern(Windows):
void OnProcessingPassStart() {}
void OnProcessingPassEnd () {}
void OnCriticalError (HRESULT Error) { writeln(Error); }
}

...
XACallbacks xcb = new XACallbacks ();
XAudio2Create( g_engine, XAUDIO2_DEBUG_ENGINE );

g_engine.RegisterForCallbacks(xcb); // <- after setting this 
callback crashes on any call later, probably stack corruption
...

//----------------------------


More information about the Digitalmars-d-learn mailing list