Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

johnnyBravo

c++: Can't get CoInitializeEx working...... says undeclared...

This topic is 5453 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

ive got this from a directx sdk example..directplay8 But this is a c++ command so thats why im asking here. ive got: CoInitializeEx(NULL, COINIT_MULTITHREADED); But when i try that in my program i get errors that CoInitializeEx and COINIT_MULTITHREADED are undeclared. Ive got the ole32.dll linked and objbase.h included. So whats the problem?

Share this post


Link to post
Share on other sites
Advertisement
Make sure that _WIN32_WINNT is #defined to at least 0x400 before the header is included.


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
this is what ive tried

#include <atlbase.h>
#ifndef _WIN32_DCOM
#define _WIN32_DCOM
#endif

#include <comdef.h>

#define _WIN32_WINNT 0x0400
#include <objbase.h>

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!