The way I personally got around this problem was to put my creation function
in a Function by itself. override the Create method and the
PreSubclassWindow methods. From the Create function set a flag that says it
is being created using the create function, rather than being subclassed by
ddx_control. call the create after the create call the function to create my
internal controls. In the PreSubclassWindow method if the flag is not set
then call the function to create the internal controls.
BOOL CMyStatic::Create(LPCSTR lpszText,DWORD dwStyle,const RECT &rect,CWnd
*pParentWnd,UINT nID)
{
m_bCreate = true;
if (CStatic::Create(lpszText,dwStyle......))
{
CreateControls();
return TRUE;
}
return FALSE;
}
void CMyStatic::PreSubclassWindow()
{
CStatic::PreSubclassWindow();
if (!m_bCreate)
{
CreateControls();
}
}
Ali R.