[FIXED] XAudio2 in Managed C++

Started by
1 comment, last by Capoeirista 6 years, 10 months ago

Hey folks,

I'm building a C# application that uses a managed C++ DLL to handle all of the rendering & audio playback.

However after linking the C++ DLL to xaudio2.lib and initializing the IXaudio2 interface I get the following error when the C# application loads:

gbQkrkL.png

Which must be something to do with C# and xaudio2.

I handle the rendering of a C# Panel in C++ using DirectX (by passing through the window handle) so I'm already linking to d3d11.lib, and I can create the DirectX device & swap chain without any problems. If I comment out the code that handles the xaudio2 initialization the file load exception disappears.

This exception is occurring right as the C# application starts up, well before the hook I have in place to catch the Loaded event, so it's a little tricky to try and isolate.

Thanks!

Advertisement

Just used 'Dependency Walker' to inspect the managed DLL I'm building... and it looks like my system is somehow missing XAUDIO2_8.DLL.

No idea why I'd be missing the DLL, but at least it's somewhere to start looking :)

Just used 'Dependency Walker' to inspect the managed DLL I'm building... and it looks like my system is somehow missing XAUDIO2_8.DLL.

No idea why I'd be missing the DLL, but at least it's somewhere to start looking :)

Aaaaand it's because my C++ DLL was linking to the 'Windows Kits' v8.1 and I'm running Windows 7, so don't have access to XAUDIO2_8.DLL. Re-linking my project to the June 2010 DirectSDK & dsound.lib fixed things up.

This topic is closed to new replies.

Advertisement