Skip to main content
GameDev.net gamedev.net
🔒 Locked

CoInitializeEx?

Started by Mage2k Mar 14, 2003 at 2:32 PM 4 replies 450+ views
Original Post
Mage2k
Mage2k
What header do I need to include to use CoInitializeEx? I keep getting undefined symbol errors..
---------------------------------------------------There are 10 kinds of people in the world:Those that understand binary, and those that dont...Mage
Mage2k
Mage2k
Oh yeah, I have tried includeing objbase.h and linking with ole32.lib, but to no avail...
---------------------------------------------------There are 10 kinds of people in the world:Those that understand binary, and those that dont...Mage
niyaw
niyaw
google for "using sdk headers".

or read the "manual" page that tells you that
quote:
msdn
Note You must include the #define _WIN32_DCOM preprocessor directive at the beginning of your code to be able to use CoInitializeEx.




[edited by - niyaw on March 14, 2003 3:49:10 PM]

Edit: Jim - Watch the language.


[edited by - Jim Adams on March 14, 2003 5:43:09 PM]
Shannon Barber
Shannon Barber
What is missing is a definition that says you want to build for later versions of Windows, on which the Ex flavor is available.


      
class CCoInitMTA
{
public:
CCoInitMTA()
{
HRESULT hr;
//If this is undefined, put "#define _WIN32_WINNT 0x0500"


// at the top of your StdAfx.h file - before *anything* else


//alternatively, you can use #define _WIN32_WINNT 0x0501 for XP


if(FAILED(hr=CoInitializeEx(NULL, COINIT_MULTITHREADED)))
_com_issue_error(hr);
}

virtual ~CCoInitMTA()
{
CoUninitialize();
}
};



[edited by - Magmai Kai Holmlor on March 15, 2003 1:37:41 PM]

[edited by - Magmai Kai Holmlor on March 15, 2003 1:37:50 PM]
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
S1CA
S1CA
Get the latest version of the Platform SDK (you can download it or purchase it on CD from the MSDN site).

IIRC the version of the Platform SDK you get with compilers such as MSVC 6 is from when Windows 98 was still in beta!

So you have none of the 98, ME, 2000 or XP specific features. Setting the WINVER symbol to 0x500 will work, but the .libs and headers are still from the beta versions of 98 so you''ll get some warnings and stuff like the newer shell calls won''t be available.

In short: upgrade your platform SDK!

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.