Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

You should implement the CExtPmBridge interface in one or more of your classes:


// In .h file:
class CSomeYourClass
: public C_BASE_OF_CSomeYourClass
, public CExtPmBridge
{
public:
DECLARE_CExtPmBridge_MEMBERS( CSomeYourClass );
CSomeYourClass();
~CSomeYourClass();
virtual void PmBridge_OnPaintManagerChanged(
CExtPaintManager * pGlobalPM
);
. . .
};

// In .cpp file:
IMPLEMENT_CExtPmBridge_MEMBERS( CSomeYourClass );

CSomeYourClass::CSomeYourClass()
{
PmBridge_Install(); // Subscribe
}

CSomeYourClass::~CSomeYourClass()
{
PmBridge_Uninstall(); // Unsubscribe
}

void CSomeYourClass::PmBridge_OnPaintManagerChanged(
CExtPaintManager * pGlobalPM
)
{
CExtPmBridge::PmBridge_OnPaintManagerChanged(
pGlobalPM
);
::AfxMessageBox( _T("The Paint Manager has changed!") );
}

If C_BASE_OF_CSomeYourClass is a Prof-UIS class, it may be already derived from CExtPmBridge and you only need to override the CExtPmBridge::PmBridge_OnPaintManagerChanged() virtual method in this case.

If C_BASE_OF_CSomeYourClass is a CWnd-derived class, it should be the first in the inheritance specification like in the sample code above.