做一个对话框,然后再创建一个新的View(比如说CListView,不能用CListCtrl)。让他显示到对话框上。怎么做
解决方案 »
- 有关Overlapped风格对话框的问题
- mfc 资源DLL问题
- 网上有很多视图的动态切换,现在我这里需要动态切换框架类
- VC中的窗口缩放
- 一个DLL工程如何通过预编译产生不同名字的DLL文件?解决送分80!
- 连接oracle数据库问题
- 请问应用程序在windows关机重起后从磁盘上丢失是怎么回事?
- 我在程序中用regsvr32 命令注册控件时会弹出一个注册成功的对话框!如何解决!
- 如何不用谢驱动程序直接控制IO端口,操作系统为win2000
- OnPaint()的问题?为什么我的程序要刷很多次才能得到正确的结果?
- 关于捕获硬件异常和软件异常的问题
- 有关在VC中做一个类似debug状态下memory窗口的问题。来者有分。
[email protected]
{ ... CCreateContext pContext;
/**
* Note:CDialig derived pointer is converted to
* CWnd pointer (a common base class for CDialog and CFrameWnd).
* Thus casting it back to CFrameWnd is also easy.
*/
CWnd* pFrameWnd = this;
pContext.m_pCurrentDoc = new CMyDocument;
pContext.m_pNewViewClass = RUNTIME_CLASS(CMyVw);
CMyVw *pView =
(CMyVw *) ((CFrameWnd*)pFrameWnd)->CreateView(&pContext);
ASSERT(pView);
pView->ShowWindow(SW_NORMAL);
/**
* After a view is created, resize that to
* have the same size as the dialog.
*/
CRect rectWindow;
GetWindowRect(rectWindow);
/**
* Leave a little space for border and title...
*/
rectWindow.right += 15;
rectWindow.top -= 10;
pView->MoveWindow(rectWindow);
CString str(AfxGetApp()->m_lpCmdLine);
/**
* Note: "CMyVw" is a CHTMLView derived class to add some
* spice to the view, I have provided a HTML page
* to which it navigates when the dialog is up.
*/
char strPath[255];
::GetCurrentDirectory(255,(LPSTR)(LPCSTR)strPath);
strcat(strPath,"\\defaultpage.html");
pView->Navigate(strPath); .... return TRUE; // return TRUE unless you set the
// focus to a control
}