Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

COM problem

v00d00h3xv00d00h3x Posts: 2Member
Im working with directshow, and the app is multithreaded, and it runs inconsistently. I noticed that I'm using CoInitialize, and that a CoInitializeEx is available which has a multithreaded option, and that sounded like it could get me better thread control for fixing the instabilities in the app. However upon attempting to use CoInitializeEx I get a compiler error for undefined symbol. has anyone ever seen this before? know how to fix it? I know the definition is in the included .h files because I searched and found it, but the compiler doesn't recognize it. It makes no sense because the CoInitialize and CoInitializeEx defs are right next to each other, and CoInitialize works! it's driving me nuts!

Comments

  • jasonjason United KingdomPosts: 88Member ✭✭
    Hi.

    Have never used COM but a quick look at MSDN states "new applications should call CoInitializeEx instead of CoInitialize." This would suggest that CoInitializeEx has superceded its earlier brother. Are you using the latest library version? I'm thinking that undefined symbol is a linker error rather than a compliler error.

    Regards, Jason
  • DesCrDesCr Posts: 5Member
    : Im working with directshow, and the app is multithreaded, and it runs inconsistently. I noticed that I'm using CoInitialize, and that a CoInitializeEx is available which has a multithreaded option, and that sounded like it could get me better thread control for fixing the instabilities in the app. However upon attempting to use CoInitializeEx I get a compiler error for undefined symbol. has anyone ever seen this before? know how to fix it? I know the definition is in the included .h files because I searched and found it, but the compiler doesn't recognize it. It makes no sense because the CoInitialize and CoInitializeEx defs are right next to each other, and CoInitialize works! it's driving me nuts!
    :

    The header file should only have declarations, no definitions. Those are found in the libraries themselves.

    Maybe if you pasted some code it'd be easier to see your problem. All I can say now is make sure you are using the proper number of parameters, as Ex has an extra. Be sure to call it once per thread, and before any other COM functions are called (except memory allocations). Those are the obvious checkpoints, but paste your code and we can get down to specifics :)
  • tinoztinoz Posts: 2Member
    As I understand it CoInitialize(NULL) calls CoInitializeEx(NULL,COINIT_APARTMENTTHREADED), so if you call CoInitialize you shouldent have any problems calling CoInitializeEx
Sign In or Register to comment.