各位高手,请大家指点一二,我在主窗口(CFrameWnd)中建立了一个子窗口(对话框)但是显示不出来,请多多指教。
解决方案 »
- 图片移动问题
- 我在1996年用QB编写了一个中型DOS软件mmsi.exe,现在有那种软件可以将其逆向工程,还原出设计框架。
- Timer本质上是否多线程的?为何我使用临界区控制(__EventingCriticalSectionAuto)失败?
- 新人:寻找VC+AO代码实例
- #####BCGControl 这个这个怎么用啊
- vc调用vb的dll
- 请问:关于对话框的问题
- 求教一个堆栈的问题
- 已实现opencv在Static控件上打开图片,怎么自己选择感兴趣区域并实现保存?
- 向一个窗口发送鼠标点击事件,能不能不改变这个窗口的Z序?
- 请问各位大虾能帮我解决这个CDialogBar优先停靠左或右而不是上下!在线等
- 在线等待,请问,怎样获得ID_File_OPEN菜单响应以后返回的值?
pFramWnd->GetClientRect (rc);
CDialog dialog;
DLGTEMPLATE *pDlg;
pDlg=new(DLGTEMPLATE);
pDlg->style =WS_BORDER | DS_3DLOOK | WS_CHILD |WS_VISIBLE ;
pDlg->cdit =1;
pDlg->cx=30;
pDlg->cy=short(rc.bottom -rc.top) ;
pDlg->x =short(rc.left);
pDlg->y =short(rc.right);
pDlg->dwExtendedStyle =NULL;
dialog.CreateIndirect (pDlg,pFramWnd);
dialog.ShowWindow(SW_SHOW);
试试。MSDN中关于使用WS_VISIBLE的说明:
Use the WS_VISIBLE style in the dialog-box template if the dialog box should appear when the parent window is created. Otherwise, you must call ShowWindow to cause it to appear. For more information on how you can specify other dialog-box styles in the template, see theDLGTEMPLATE structure in the Win32 SDK documentation.
pDlg=new(DLGTEMPLATE);这两行定义转到其他地方试试,如果你的代码是在一个函数里的
哪么函数执行结束,pDlg就被释放掉了,