NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2786

'type' : invalid operand for __uuidof

The __uuidof operator takes a user-defined type with a GUID attached or an object of such a user-defined type.

Possible causes

Example

struct __declspec(uuid("00000000-0000-0000-0000-000000000000")) A {
};

void foo(void)
{
    __uuidof(int);      // error C2786
    __uuidof(int *);   // error C2786
    __uuidof(A **);      // error C2786

// no error
    __uuidof(A);
    __uuidof(A *);
    __uuidof(A &);
    __uuidof(A[]);

    int i;
    int *pi;
    A **ppa;

    __uuidof(i);   // error C2786
    __uuidof(pi);   // error C2786
    __uuidof(ppa);   // error C2786
}