怎么样在基于对话框的程序内调用CreateWindow创建窗口
我做了试验,在
void CRegularDllCallDlg::OnBnClickedAddWindow(){
HWND hWnd= CreateWindow(
"MainWClass", // name of window class
"Sample", // title-bar string
WS_OVERLAPPEDWINDOW, // top-level window
CW_USEDEFAULT, // default horizontal position
CW_USEDEFAULT, // default vertical position
CW_USEDEFAULT, // default width
CW_USEDEFAULT, // default height
//GetSafeHwnd(), // no owner window
//NULL,
(HWND) NULL,
//theApp.m_pMainWnd->m_hWnd,
// CWnd::GetParent()->m_hWnd,
//(HWND)this,
(HMENU) NULL, // use class menu
::GetModuleHandle("RegularDllCall.exe"), // handle to application instance
// AfxGetInstanceHandle(),
//AfxGetInstanceHandle(),
(LPVOID) NULL);
ShowWindow( SW_SHOW);
}
但是窗口并不显示,请问怎么做才行.