dll下创建窗口

海边白杨 2014-03-29 09:31:10
各位大神,我原来有一个mfc做的的控件,里面有个创建隐藏子窗口的函数,但是我改成了一个dll 的项目,就不能用了,究其原因,是hChildWnd = CreateWindow(
pClassName, // pointer to registered class name
pWindowName, // pointer to window name
WS_CHILD, // window style
0, // horizontal position of window
0, // vertical position of window
1, // window width
1, // window height
hWnd, // handle to parent or owner window
NULL, // handle to menu or child-window identifier
//GetWindowWord(hWnd, GWW_HINSTANCE),
(HINSTANCE)GetWindowWord(hWnd, GWL_HINSTANCE),
// handle to application instance
NULL); // pointer to window-creation data

中的hWnd是空的,应该传进来的是m_hWnd,就是说父窗口句柄是空的,在我的mfc中没有给这个参数赋值,是mfc生成时自动就有的,那我这个dll却没有生成,我该建一个父窗口,还是怎么做?求支援啊!!!!!!
...全文
151 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,531

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 模式及实现
社区管理员
  • 模式及实现社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧