如何获得对话框指针 .
2011-10-14 14:46
225 查看
获得对话框指针: 假设CMyDialog为对话框类
1.先在CMyDialog.cpp中声明一个全局变量CMyDialog* pDlg;
2在OnInitDialog()的时候,pDlg = this;
3.在别的类使用他的时候,在别的类的Cpp中添加extern CMyDialog* pDlg;
4.pDlg->yourfunction();
如何使用Tab Control 控件 设置现有页面
void CPage1::OnBnClickedButton1() { int temp=0; if(GetCheckedRadioButton(IDC_RADIO1,IDC_RADIO2)==IDC_RADIO1) temp++; if(GetCheckedRadioButton(IDC_RADIO3,IDC_RADIO4)==IDC_RADIO3) temp++; if(GetCheckedRadioButton(IDC_RADIO5,IDC_RADIO6)==IDC_RADIO5) temp++; //获取View类指针 CMainFrame *pMain=(CMainFrame *)AfxGetApp()->m_pMainWnd; CintelligentjudgingView *pView=(CintelligentjudgingView *)pMain->GetActiveView(); if(temp>=2) { extern CQue *myquedlg; pView->type[0]++; MessageBox((CString)"Please continue to next step!"); CRect r; myquedlg->m_tabcontrol.GetClientRect(&r); myquedlg->m_tabcontrol.SetCurSel(1); myquedlg->page1.SetWindowPos (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW); myquedlg->page2.SetWindowPos (NULL,10,30,r.right-20,r.bottom-40,SWP_SHOWWINDOW); myquedlg->page3.SetWindowPos (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW ); } // TODO: 在此添加控件通知处理程序代码 }
相关文章推荐
- 如何获得对话框指针
- 在对话框类中如何获得视类和文档类的指针
- VC如何获得对话框指针
- 如何在对话框中获得文档的指针?
- 在线程中如何获得主对话框中的指针?
- CSplitterWnd窗口拆分后如何获得指定窗口的指针
- VC中外部函数如何获得对话框成员变量
- Inside VCL:接口指针调用函数的时候,如何获得对象指针以完成函数调用?
- Inside VCL:接口指针调用函数的时候,如何获得对象指针以完成函数调用?
- [Web]如何实现从模式窗体-网页对话框 中获得返回值
- [Web]如何实现从模式窗体-网页对话框 中获得返回值
- MFC单文档子对话框如何获得View类的变量
- 在框架窗口中如何获得,视图类的指针以及文档,视图,框架窗口指针的获取与应用
- VC中外部函数如何获得对话框成员变量
- Inside VCL:接口指针调用函数的时候,如何获得对象指针以完成函数调用?
- MFC通过对话框窗口句柄获得对话框对象指针
- 单文档视图中如何获得视图指针
- Inside VCL:接口指针调用函数的时候,如何获得对象指针以完成函数调用?
- 如何通过代码获得应用程序主窗口的 指针?
- C++ MFC 其他函数获得主对话框指针并使用成员的方法