Click here to Skip to main content
15,902,032 members
Home / Discussions / COM
   

COM

 
GeneralRe: Help!! - "both" components Pin
Anonymous8-Feb-04 12:09
Anonymous8-Feb-04 12:09 
GeneralRe: Help!! - "both" components Pin
LasVegasGuy8-Feb-04 12:14
LasVegasGuy8-Feb-04 12:14 
GeneralRe: Help!! - "both" components Pin
Anonymous8-Feb-04 18:56
Anonymous8-Feb-04 18:56 
GeneralRe: Help!! - "both" components Pin
Anonymous9-Feb-04 8:33
Anonymous9-Feb-04 8:33 
GeneralIEnumIDList Pin
Tristan Rhodes6-Feb-04 5:27
Tristan Rhodes6-Feb-04 5:27 
GeneralRe: IEnumIDList Pin
Jörgen Sigvardsson7-Feb-04 3:42
Jörgen Sigvardsson7-Feb-04 3:42 
Generalcomplier error:...undefined class 'ATL_NO_VTABLE Pin
Abhi Lahare6-Feb-04 2:02
Abhi Lahare6-Feb-04 2:02 
GeneralRe: complier error:...undefined class 'ATL_NO_VTABLE Pin
Mike Dimmick6-Feb-04 2:50
Mike Dimmick6-Feb-04 2:50 
It's a macro which expands to __declspec(novtable) for Visual C++. This is a hint to the compiler not to set the virtual function table pointer in the constructor. From the documentation:

"This form of __declspec can be applied to any class declaration, but should only be applied to pure interface classes, that is, classes that will never be instantiated on their own. The __declspec stops the compiler from generating code to initialize the vfptr in the constructor(s) and destructor of the class. In many cases, this removes the only references to the vtable that are associated with the class and, thus, the linker will remove it. Using this form of __declspec can result in a significant reduction in code size.

"If you attempt to instantiate a class marked with novtable and then access a class member, you will receive an access violation (AV)."

You don't normally use an ATL object derived from CComObjectRootEx directly; instead, the ATL class factory generates a CComObject<CSimpleObject> when it's asked to by COM. Eliminating the vtable can save on both code size (through not setting the vfptr) and on data size (through omitting CSimpleObject's vtable).

If you don't want to use CSimpleObject as a COM object, remove ATL_NO_VTABLE, all of the CComXxx base classes, and IDispatchImpl.

If instead you want to use the COM object from your MFC application (leaving the object implementation in the DLL), use ClassWizard or a #import statement to reference the type library. You could also use the interface headers generated from the IDL file that describes the object's interfaces. Use CoCreateInstance to create the object.
GeneralRe: complier error:...undefined class 'ATL_NO_VTABLE Pin
Abhi Lahare6-Feb-04 3:28
Abhi Lahare6-Feb-04 3:28 
QuestionHow can i get properties of com object dynamically Pin
Inam5-Feb-04 19:47
Inam5-Feb-04 19:47 
AnswerRe: How can i get properties of com object dynamically Pin
Mike Dimmick6-Feb-04 3:23
Mike Dimmick6-Feb-04 3:23 
GeneralRe: How can i get properties of com object dynamically Pin
Inam7-Feb-04 7:20
Inam7-Feb-04 7:20 
GeneralCommercial ActiveX Control - ClistCtrl/CListView Pin
Charles Roderick4-Feb-04 5:10
Charles Roderick4-Feb-04 5:10 
GeneralRe: Commercial ActiveX Control - ClistCtrl/CListView Pin
Jörgen Sigvardsson9-Feb-04 9:59
Jörgen Sigvardsson9-Feb-04 9:59 
GeneralRe: Commercial ActiveX Control - ClistCtrl/CListView Pin
Charles Roderick9-Feb-04 12:08
Charles Roderick9-Feb-04 12:08 
GeneralSHGetPathFromIDList - Problem Pin
Tristan Rhodes4-Feb-04 3:53
Tristan Rhodes4-Feb-04 3:53 
GeneralSolved Pin
Tristan Rhodes4-Feb-04 10:55
Tristan Rhodes4-Feb-04 10:55 
GeneralRe: SHGetPathFromIDList - Problem Pin
Mike Dimmick5-Feb-04 0:58
Mike Dimmick5-Feb-04 0:58 
GeneralSHBrowseForFolder problem Pin
Tristan Rhodes4-Feb-04 1:19
Tristan Rhodes4-Feb-04 1:19 
GeneralRe: SHBrowseForFolder problem Pin
Tristan Rhodes4-Feb-04 2:01
Tristan Rhodes4-Feb-04 2:01 
GeneralPartial Solution Pin
Tristan Rhodes4-Feb-04 2:55
Tristan Rhodes4-Feb-04 2:55 
GeneralMethod overloading Pin
Anonymous3-Feb-04 4:19
Anonymous3-Feb-04 4:19 
GeneralRe: Method overloading Pin
Steve S3-Feb-04 22:55
Steve S3-Feb-04 22:55 
GeneralRe: Method overloading Pin
Anonymous4-Feb-04 0:03
Anonymous4-Feb-04 0:03 
GeneralPaste img from any application like Paint, Ms Photoeditor,etc Pin
Filomela2-Feb-04 20:47
Filomela2-Feb-04 20:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.