directx queryinterface

Started by
4 comments, last by urizn 19 years ago
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
Advertisement
Try adding dxguid.lib to the linker options.
that did it thanks
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
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

Learn about game programming!Games Programming in C++: Start to Finish
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

This topic is closed to new replies.

Advertisement