I'm trying to dynamically subclass a field on a property page. The code looks like this:
BOOL CMyPropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_myedithandler.SubclassDlgItem(IDC_TEXT,this);
return TRUE;
}
The SubclassDlgItem fails on an ASSERT in
BOOL CWnd::Attach(HWND hWndNew)
{
ASSERT(m_hWnd == NULL); //OK
ASSERT(FromHandlePermanent(hWndNew) == NULL); //fails
...
I used the same override logic on an edit field in a regular dialog without any problem. Is there something special about subclassing on a property page? Or can someone point me to something else I am doing wrong?
BOOL CMyPropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_myedithandler.SubclassDlgItem(IDC_TEXT,this);
return TRUE;
}
The SubclassDlgItem fails on an ASSERT in
BOOL CWnd::Attach(HWND hWndNew)
{
ASSERT(m_hWnd == NULL); //OK
ASSERT(FromHandlePermanent(hWndNew) == NULL); //fails
...
I used the same override logic on an edit field in a regular dialog without any problem. Is there something special about subclassing on a property page? Or can someone point me to something else I am doing wrong?