<script src="../163new.js" type="text/javascript"></script>
主 题: 怎么得到一个分割后的窗口指针或句柄???
SDI程序,主窗口被分成了3个子窗口,每个子窗口有各自的视类,
请问,我怎么得到其中一个子窗口的指针或句柄
回复人: jiangsheng(蒋晟.MSMVP2004Jan) ( ) 信誉:243 2002-01-21 17:12:31Z 得分: 0 ? CSplitterWnd::GetPane
CWnd* GetPane( int row, int col );
Return Value
Returns the pane at the specified row and column. The returned pane is usually a CView-derived class.
Top
回复人: hgw111(hg) ( ) 信誉:99 2002-01-21 17:42:13Z 得分: 0 ? 参数是什么意思?
Top
回复人: jiangsheng(蒋晟.MSMVP2004Jan) ( ) 信誉:243 2002-01-21 17:57:26Z 得分: 0 ? 行/列
Top
回复人: hgw111(hg) ( ) 信誉:99 2002-01-21 18:01:35Z 得分: 0 ? 我这样做怎么错了?
我在其中的一个窗口的视类中运行如下代码:
CSplitterWnd * m_pswnd=(CSplitterWnd)GetActiveWindow();
m_pswnd->GetPane(0,0);
运行到m_pswnd->GetPane(0,0)报错,为什么?
我该如何在一个窗口的视类中得到另一个子窗口的指针或句柄??
Top
回复人: jiangsheng(蒋晟.MSMVP2004Jan) ( ) 信誉:243 2002-01-21 18:05:20Z 得分: 10 ? 你在哪里Get的??
GetActiveWindow();是CSplitterWnd 还是它的一个Pane?
Top
回复人: hgw111(hg) ( ) 信誉:99 2002-01-22 09:03:59Z 得分: 0 ? 详细情况是这样的:
SDI程序,主窗口被分成了3个子窗口,每个子窗口有各自的视类,我在其中的一个视类调用的该代码CSplitterWnd * m_pswnd=(CSplitterWnd)GetActiveWindow();
m_pswnd->GetPane(0,0);
我试过直接用GetActiveWindow(),得到的是主窗口(包括三个子窗口)的指针
Top
回复人: robothn(雷鸟) ( ) 信誉:100 2002-01-22 09:29:24Z 得分: 10 ? Mainframe 中应该有一个 CSplitterWnd 的成员变量,设为m_wndSplitter
CWnd* pPaneShow = m_wndSplitter.GetPane(0,0);
你自己再转换
Top
回复人: sunlightbj(阳光) ( ) 信誉:100 2002-01-22 09:40:27Z 得分: 10 ? CMainFrame* main = (CMainFrame*)AfxGetApp()->m_pMainWnd;
CWnd* pPaneShow = main->m_wndSplitter.GetPane(row,col);
Top
回复人: robothn(雷鸟) ( ) 信誉:100 2002-01-22 09:45:09Z 得分: 0 ? 这样转换:
(CMyWnd*) pMyWnd = (CMyWnd*)m_wndSplitter.GetPane(0,0);
Top
结贴 ,得分记录: jiangsheng (10)、 robothn (10)、 sunlightbj (10)、
<script type="text/javascript">
</script> <script src="../../pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script>