Tuesday, August 28, 2007

Guid Error in VC++

Error while using GUIDs  :
-------------------------------------
I defined the guids using DEFINE_GUID() macro
and static const GUID identifier as a GUID variable...

Both of them give me an error at the CLSID .

For Example I used the  CLSID_GrabberSample.

 DEFINE_GUID(CLSID_GrabberSample,
   0x2fa4f053, 0x6d60, 0x4cb0, 0x95, 0x3, 0x8e, 0x89, 0x23, 0x4f, 0x3f, 0x73);

  During the reference of CLSID_GrabberSample , I got the unresolved symbol linker error in CLSID_GrabberSample.


I changed the GUID as follows :

  static const GUID CLSID_GrabberSample = {0x2F, 0xA4,0xF0,0x53,0x6D,0x60,0x4C,0xB0,0x95,0x3,0x8E,0x89,0x23,0x4F,0x3F,0x73};

  -Once again I got an error too many initializers for static const GUID...


Solution :
 I included the "initguid.h" header file afterwards it is working fine.

0 comments: