I'm trying to subclass an edit control using WTL. I am using this article for instruction
http://www.codeproject.com/wtl/subcl...ditcontrol.asp
So, basically, what I have, is a bunch of edit boxes that I create from a rc template, and my edit control subclass (in the article, this is CEditEnterAsTabT, in my code it's CEditArrowsT), and when I try to AttachToDlgItem (actually subclass the edit controls) in my dialogs OnInitDlg routine.
AttachToDlgItem
In this method, SubclassWindow in the failiure. On MSDN it commentsCode:BOOL AttachToDlgItem(HWND parent, UINT dlgID) { m_dlgItem = dlgID; m_parent = parent; m_hWnd = ::GetDlgItem(parent, dlgID); return SubclassWindow(m_hWnd); }
But I don't call create, they're dialog elements programmed into the resource script. This comment is the only reason I can see for failure, is there anyway I might get around it? I might try hardcoding the edit controls into the dialog if there isn't but that seems very inconvenient.Do not call SubclassWindow if you have already called Create.



LinkBack URL
About LinkBacks


