Click to See Complete Forum and Search --> : sharing ATL property pages


john dixson
May 4th, 1999, 12:37 PM
Is it possible to share property pages between ATL controls?

When the apply button is pressed the following code will only work for control #1 because of the CComQIPtr<> template;


STDMETHOD(Apply)(void)
{
USES_CONVERSION;
ATLTRACE(_T("CTempProp::Apply\n"));
for (UINT i = 0; i < m_nObjects; i++)
{
CComQIPtr<ICtl1, &IID_ICtl1> pCtl(m_ppUnk[i]);
short ntemp = (short)GetDlgItemInt(IDC_TEMP);
if FAILED(pCtl->put_Temp(ntemp))
{
CComPtr<IErrorInfo> pError;
CComBSTR strError;
GetErrorInfo(0, &pError);
pError->GetDescription(&strError);
MessageBox(OLE2T(strError), _T("Error"), MB_ICONEXCLAMATION);
return E_FAIL;
}
}
m_bDirty = FALSE;
return S_OK;
}