MFC对话框中创建一个自定义的CView的问题

gig886 2015-07-29 04:43:50

如图,代码执行到82行之后就直接把对话框给显示出来了,后续的代码没有执行,求解?
而且一旦关闭对话框软件就直接挂了。
...全文
325 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
二班的码农 2015-07-30
  • 打赏
  • 举报
回复
#define AFX_WS_DEFAULT_VIEW (WS_CHILD | WS_VISIBLE | WS_BORDER) 你在create时,将AFX_WS_DEFAULT_VIEW传进去,视图在创建时后立刻显示 至于为何会崩溃,就不太清楚了,会不会是其它参数的问题 CWnd::Create virtual BOOL Create( LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); Return Value Nonzero if successful; otherwise 0. Parameters lpszClassName Points to a null-terminated character string that names the Windows class (a WNDCLASS structure). The class name can be any name registered with the global AfxRegisterWndClass function or any of the predefined control-class names. If NULL, uses the default CWnd attributes. lpszWindowName Points to a null-terminated character string that contains the window name. dwStyle Specifies the window style attributes. WS_POPUP cannot be used. If you wish to create a pop-up window, use CWnd::CreateEx instead. rect The size and position of the window, in client coordinates of pParentWnd. pParentWnd The parent window. nID The ID of the child window. pContext The create context of the window. Remarks Creates a Windows child window and attaches it to the CWnd object.

24,860

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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