Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CoInitializeEx()

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
Ok... I'm new to .Net, and basically new to Visual C++, though am very confident in good old fashioned C++ (namely g++ and gcc and the like, but haven't touched Visual since '95 or so)

Anyway, I'm working on a .Net project, I think it should be pretty easy, but I'm stuck early... stuck using CoInitializeEx(), though Visual Studio pops up with the completion of the function after I type it in, when I go to build I get error 2065, CoInitializeEx: Undeclared Identifier... and then the resulting errors that follow such a thing.

So I trashed everything, made a default hello world program, and tried just to run CoInitializeEx()... no go. I've looked it all up, and I think I see what the function does, but that doesn't help me find it....

Do I need to register something somewhere, a simple include (fairly certain that's not it), or something totally different?

Thanks,
Rob
 
I always find it right after I post....

for those who might have the same problem, the solution is...


#include <afxole.h>
#include <objbase.h>

(found on these boards in fact)

-Rob
 
in your project setting add WIN32_DCOM to your preprocessor definitions.
 
Yeah, I had thought maybe that was the route, but I can't find
Project
->Setting
->Preprocessor definitions.... where would these be?

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top