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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CoCreateGUID() prototype + definition 1

Status
Not open for further replies.

rpet

Programmer
Jun 5, 2000
87
DE
Hello all.

Could someone please tell me what it takes to use function CoCreateGUID()?

According to the MSDN the function is prototyped in objbase.h and defined in ole32.lib. That's obviously correct but whenI try to use this function I get error C2065 ('CoCreateGUID' undeclared identifier).

The include file path is correct, but the compiler does not get the prototype - and I don't know why. Even this mini sample program won't compile (err C2065).

Code:
#include <guiddef.h>
#include <objbase.h>

void test() {
    GUID g;
    CoCreateGUID(&g);
}

I am quite sure I missed a compiler setting or a #define but I don't know which one. I can use any other COM function in my program (CoCreateInstance, CoInitialize and so on), no problem, but CoCreateGUID don't work.

-> MS VC++ 6, MS Platform SDK (July 2000), Win2000 Pro SP2

Thanks in advance.
 
The only problem I can see is the fact you are using:
Code:
CoCreateGUID
instead of this
Code:
CoCreateGuid
 
Argh! I need to go on vacation. It's urgent! ;-)
Thank you hcexi.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top