• Advertisement
Sign in to follow this  

[FIXED] XAudio2 in Managed C++

Recommended Posts

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!

Edited by Orangeatang

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement