METHOD_PROLOGUE

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

Use the METHOD_PROLOGUE macro to maintain the proper global state when calling methods of an exported interface.

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();
   }

For additional information, see Technical Note 38 and "Managing the State Data of MFC Modules" in Creating New Documents, Windows, and Views, which is in Visual C++ Programmer’s Guide.