Jump to content
  • Advertisement
Sign in to follow this  
Capoeirista

[FIXED] XAudio2 in Managed C++

This topic is 565 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!