RSS
Follow Us
Contribute
 
 
 
 
Print Preferences

Error C2787: (identifier) : no GUID has been associated with this object

 

From $1

Table of contents
  1. 1. Cause
  2. 2. Solution
  3. 3. About This Article

Cause

The __uuidof operator takes a user-defined type with a GUID attached or an object of such a user-defined type. This error occurs when the argument is a user-defined type with no GUID. Ex:

#include <windows.h>
struct F {};

int main() {
   __uuidof(F);   // C2787
}

Solution

Possible resolution:

#include <windows.h>

struct __declspec(uuid("00000000-0000-0000-c000-000000000046")) F;

int main() {
   __uuidof(F);   
}

About This Article

This article is a derivative work based on Compiler Error C2787 which is provided by MSDN Community Content - Visual C++.

 
 
 
 
 
Creative Commons License
All content is licensed under a Creative Commons Attribution-Noncommercial 3.0 License.
Powered by MindTouch Core v.9.02.2