1

Topic: ATL

Never tightly worked with a subject;
Here such code it is normal? Confuses a method of removal of object in

CVCClientDlgAutoProxy::CVCClientDlgAutoProxy ()
{
EnableAutomation (); //to enable OLE automation for an object.
//To keep the application running as long as an automation
// object is active, the constructor calls AfxOleLockApp.
AfxOleLockApp ();
//Get access to the dialog through the application's
//main window pointer. Set the proxy's internal pointer
//to point to the dialog, and set the dialog's back pointer to
//this proxy.
ASSERT (AfxGetApp ()-> m_pMainWnd! = NULL);
ASSERT_VALID (AfxGetApp ()-> m_pMainWnd);
ASSERT_KINDOF (CVCClientDlg, AfxGetApp ()-> m_pMainWnd);
m_pDialog = (CVCClientDlg *) AfxGetApp ()-> m_pMainWnd;
m_pDialog-> m_pAutoProxy = this;
}
CVCClientDlgAutoProxy::~CVCClientDlgAutoProxy ()
{
//To terminate the application when all objects created with
// with automation, the destructor calls AfxOleUnlockApp.
//Among other things, this will destroy the main dialog
if (m_pDialog! = NULL)
m_pDialog-> m_pAutoProxy = NULL;
AfxOleUnlockApp ();
}

2

Re: ATL

The correct title of subject MFC