I get error 1400 - ERROR_INVALID_WINDOW_HANDLE: Invalid window handle for each and every time I tryh it. Here is essentially the code for my dialog
Code:
class WtlKbdCtrlsDlg :
public CDialogImpl<WtlKbdCtrlsDlg>,
public CDialogResize<WtlKbdCtrlsDlg>,
public CMessageFilter
{
WtlWindow * parent;
CEditArrowsT<CWindow> * arr;
public:
enum { IDD = IDD_KBDCTRLS };
BEGIN_MSG_MAP(CAboutDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_CLOSE, OnClose)
COMMAND_ID_HANDLER(IDOK, OnOKCancel)
END_MSG_MAP()
virtual BOOL PreTranslateMessage(MSG * msg)
{
return IsDialogMessage(msg);
}
LRESULT OnInitDialog(UINT msg, WPARAM wparam, LPARAM lparam, BOOL & handled)
{
arr = new CEditArrowsT<CWindow>[16];
for(int i = 0; i < 16; ++i)
{
if(!arr[i].AttachToDlgItem(this->m_hWnd, IDC_NYAW + i))
{
DWORD err = ::GetLastError(); // Always 1400
}
}
CenterWindow();
_Module.GetMessageLoop()->AddMessageFilter(this);
Here;s the rest
http://zxcvbn.googlecode.com/svn/trunk/wtltrip/WtlDlg.h
http://zxcvbn.googlecode.com/svn/trunk/wtltrip/