Sign in to follow this  
urizn

directx queryinterface

Recommended Posts

Good day im trying to create direct x code to read from the soundcard and I'm currently stuck on a linking error apparently the compiler doesnt like if( FAILED( hr = g_pDSBCapture->QueryInterface( IID_IDirectSoundNotify, (LPVOID*)&g_pDSNotify ) ) ) for soem reason. The error it gives me is LINK : error LNK2020: unresolved token (0A000016) IID_IDirectSoundNotify LINK : fatal error LNK1120: 1 unresolved externals any help would be greatly appreciated thanks

Share this post


Link to post
Share on other sites
i ran inot another problem after i got it to compile

seems CoInitialize() never succeeds

the entire code is here
http://www.noidea128.org/sourcefiles/14294.html

again any help is greatly appreciated.. rewarded even.. perhaps a statue of your likeness made out of the pizza boxes in my room

also could you explain what coinitialize does and why i need it. i have a general idea but the msdn site doesnt explain it well

Share this post


Link to post
Share on other sites
CoInitialize sets up the COM datastructures and underlying components. That's basically all you need to remember.

With every CoInitialize, you need to pair it with a CoUninitialize...which I saw you had. :)

I use the newer (and recommended) method of setting up COM.

1. Before the windows.h file, #define _WIN32_DCOM
2. Use CoInitializeEx( NULL, COINIT_MULTITHREADED );

this tends to always work for me just fine..(leave the CoUninitialize as is).

hth

Share this post


Link to post
Share on other sites
Thanks for your help

The code compiles and works perfectly. But I tried to run it on another computer and it didnt work (same windows version) . Simply put how can i fix this. would a precompiled header file help and if so how do i make one

Again thanks for your time

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