Export (0) Print
Expand All
TRY
Expand Minimize

METHOD_PROLOGUE

Maintains the proper global state when calling methods of an exported interface.

METHOD_PROLOGUE(theClass, localClass )

Parameters

theClass
Specifies the name of the class whose interface map is being implemented.
localClass
Specifies the name of the local class that implements the interface map.

Remarks

Typically, member functions of interfaces implemented by CCmdTarget-derived objects already use this macro to provide automatic initialization of the pThis pointer. For example:

class CInnerUnknown : public IUnknown
   ...
   CInnerUnknown InnerUnknown;
   ...
// Inner IUnknown implementation 

   STDMETHODIMP_(ULONG) CInnerUnknown::AddRef()
   {
   METHOD_PROLOGUE(CCmdTarget, InnerUnknown)
   return pThis->InternalAddRef();
   }

See Also

MFC Macros and Globals | Technical Note 38 | Creating New Documents, Windows, and Views

Show:
© 2014 Microsoft