在VIEW类中怎样获取MainFrame里面的数据!!! 我在MainFrame里面加了一个消息映射,IDM_FILE_OPEN在MainFrame里面获取到了文件的路径,但是怎样在VIEW类中获取他呢 ??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我是这样做的,好像不行!在MainFrame里面定义了个VIEW类指针 void CMainFrame::OnFileOpen() { // TODO: Add your command handler code here CFileDialog filedialog(TRUE); CString strpath; char pathdir[50]; memset(pathdir,0,50); int pos=-1; if(filedialog.DoModal()==IDOK) { strpath=filedialog.GetPathName(); //AfxMessageBox(strpath); pos=strpath.ReverseFind('\\'); strpath=strpath.Left(pos+1);//获取文件目录 strcpy(pathdir,strpath); m_pImageView=new CShowImageView; m_pImageView->GetPathDir(pathdir); }} CShowImageView *m_pImageView = (CShowImageView*)this->GetActiveView(); 关于GDI+的裁剪 关于MFC的列表框和单选按钮 遇到了一个诡异的问题。 VC6.0 使用串口类CSeriaPort 通信问题 OpenGL显示刷新问题 请问怎么判断一个文件夹中是否有一个文件 急!几个关于面向对象的问题——我明天要考试!!! 在 Windows 窗体中如何获取与本机相连打印机的名称?求解 我的任务管理器(mstask.exe)就剩一个框了,菜单和标签都不见了-----紧急呼叫! 关于VC++的简单问题 如何删除系统自动生成的单文档应用程序界面上的工具栏? ADSL拨号的原理是什么,怎样自己做一个拨号器呢?
在MainFrame里面定义了个VIEW类指针
void CMainFrame::OnFileOpen()
{
// TODO: Add your command handler code here
CFileDialog filedialog(TRUE);
CString strpath;
char pathdir[50];
memset(pathdir,0,50);
int pos=-1;
if(filedialog.DoModal()==IDOK)
{
strpath=filedialog.GetPathName();
//AfxMessageBox(strpath);
pos=strpath.ReverseFind('\\');
strpath=strpath.Left(pos+1);//获取文件目录
strcpy(pathdir,strpath);
m_pImageView=new CShowImageView;
m_pImageView->GetPathDir(pathdir);
}
}