关于以sdk为主框架,与mfc混合编程中得到mfc控件父窗口指针的问题!
chw74 2002-11-05 08:55:49 关于以sdk为主框架,与mfc混合编程中得到mfc控件父窗口指针的问题!
我以sdk为主框架结合mfc类库编程,想用mfc的toolbar控件,可是却得到了这样的错误!
C:\c_work\skk_mfc\skk_mfc.cpp(95) : error C2664: 'CreateEx' : cannot convert parameter 1 from 'struct HWND__ *' to 'class CWnd *'
源程序如下:
case WM_CREATE:
if (!m_wndToolBar.CreateEx(hwnd, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY |CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_TOOLBAR1))
{
TRACE0("Failed to create toolbar\n");
return 0; // fail to create
}
return 0;
请问如何将父窗口句柄转换为CWnd* pParentWnd(Pointer to the window that is the toolbar’s parent)