Can gcc generate COM-compatible C++ class?‏

杨荣蔚 yangrongwei@hotmail.com
Mon May 30 08:36:00 GMT 2011



Hello,

I'm developing CFPlugIn for Apple's iOS on Mac X using XCode 3.2 (gcc 4.2.1)

According to Apple's document, the CFPlugIn is COM-compatible.
http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFPlugIns/Concepts/com.html#//apple_ref/doc/uid/20001158-CJBEJBHH

BUT, According to the comment for IUnknown in CoreFoundation/CFPlugInCOM.h , the compatibility depends on compiler.
/* This a definition of IUnknown as pure abstract virtual C++ class. This class will work only with compiler that can product COM-compatible object layout for C++ classes. egcs can not do this. MetroWerks can do this (if you subclass from __comobject) */

My question is:
"Is gcc the compiler that can product COM-compatible object layout for C++ class?"


You may also refer to this thread for the answers from MSDN for COM's C/C++ compatibility
http://social.msdn.microsoft.com/Forums/en-US/vcmfcatl/thread/72cf41cb-4d73-4c5b-a986-b1c857a30fd5


Sincerely,
Raymond Yang.
 		 	   		  


More information about the Gcc-help mailing list