unresolved externals when instantiating COM objects
-
I am using VisualC++ to write a multimedia program using COM. I get link errors when I compile my program stating that CLSID_FilterGraph and IID_IGraphBuilder are unresolved externals. Here is the code they appear in: hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**)&pBuilder); The code is straighforward and the CLSID_FilterGraph can even be found using search in the file uuids.h. When I include it the link errors remain. I made sure to include DirectX headers and libraries in the link paths for VisualC++. Here is a list of all of the headers and defines I have included: #define _WIN32_DCOM #include #include #include #include #define WIN32_LEAN_AND_MEAN #include #include #include #include #ifndef GetWindowLongPtr #define GetWindowLongPtrA GetWindowLongA #define GetWindowLongPtrW GetWindowLongW #ifdef UNICODE #define GetWindowLongPtr GetWindowLongPtrW #else #define GetWindowLongPtr GetWindowLongPtrA #endif // !UNICODE #endif // !GetWindowLongPtr #ifndef SetWindowLongPtr #define SetWindowLongPtrA SetWindowLongA #define SetWindowLongPtrW SetWindowLongW #ifdef UNICODE #define SetWindowLongPtr SetWindowLongPtrW #else #define SetWindowLongPtr SetWindowLongPtrA #endif // !UNICODE #endif // !SetWindowLongPtr #ifndef GWLP_USERDATA #define GWLP_USERDATA (-21) #endif I realize that some of these defines and included are irrelavent. I copied everything from the example files (which worked) in the way of headers and I thought I should show you what I had tried. I've been staring at this problem for a day now and any help would be greatly appreciated. Thanks Jeff