在Dialog调用中调用系统的Create函数时,遇到了这个问题。
BOOL CWnd::Create(LPCTSTR lpszClassName,LPCTSTR lpszWindowName, DWORD dwStyle,const RECT& rect,CWnd* pParentWnd, UINT nID,CCreateContext* pContext)
其中,参数“CWnd *pParentWnd”需要对当前的创建进行转换
HWND hWnd = AfxGetMainWnd()->m_hWnd;CWnd *pwnd = (CFrameWndEx*)CWnd::FromHandle(hWnd);Create(L"",L"",WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),pwnd,10000);
一开始没有进行转换直接写的是this->m_hwnd,会出现以下错误