The information in this article applies to:
SYMPTOMSWhen building a project with ATL 3.0 you may get a compiler error c2787 (no GUID has been associated with this object). CAUSE
The newer versions of MIDL use the compiler facility [__declspec(uuid())]
to tag a GUID to an interface in the header files it generates. ATL version
3.0 makes use of this fact in the implementation of COM_INTERFACE_ENRY
macro; it now uses the keyword __uuidof() to extract the interface ID from
the MIDL-generated header. ATL 2.1 uses the token pasting operator
(IID_##IFoo) to get the interface ID. This action requires including the
MIDL-generated header and also the "project_i.c", which MIDL generated.
RESOLUTIONDefine the preprocessor symbol _ATL_NO_UUIDOF in the C/C++ tab of the Project Settings dialog box. This forces ATL to use the token pasting operator (##) rather than __uuidof() when forming the interface ID. STATUSThis behavior is by design. MORE INFORMATIONSample Code
Newer MIDL headers files use the macros DECLSPEC_UUID() or
MIDL_INTERFACE(), which expand to __declspec(uuid()). MIDL versions 3.01.75
and later use the __declspec directive.
REFERENCES
"Porting from ATL 2.1" in the online help.
© Microsoft Corporation 1998, All Rights Reserved. Additional query words: kbDSupport
Keywords : kbCOMt kbVC600 kbATL300 kbGrpMFCATL kbMIDL |
Last Reviewed: November 23, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |