VC文本编程
请问如何在自定义类中获得View类中文本框的内容。我用char*str;CMainFrame*pMain=(CMainFrame*)AfxGetApp()->m_pMai...
请问如何在自定义类中获得View类中文本框的内容。
我用
char *str;
CMainFrame *pMain=(CMainFrame *)AfxGetApp()->m_pMainWnd;
CFileSelectView *pView=(CFileSelectView *)pMain->GetActiveView();
pView->GetDlgItemText(IDC_EDIT1,str);
为什么报错呢?
我加载了头文件。
--------------------Configuration: FileSelect - Win32 Debug--------------------
Compiling...
showdlg.cpp
c:\documents and settings\owner\桌面\vc\复件 fileselect\showdlg.cpp(4) : warning C4652: compiler option 'Generate Browser Info' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
c:\documents and settings\owner\桌面\vc\复件 fileselect\fileselectview.h(28) : error C2143: syntax error : missing ';' before '*'
c:\documents and settings\owner\桌面\vc\复件 fileselect\fileselectview.h(28) : error C2501: 'CFileSelectDoc' : missing storage-class or type specifiers
c:\documents and settings\owner\桌面\vc\复件 fileselect\fileselectview.h(28) : error C2501: 'GetDocument' : missing storage-class or type specifiers
执行 cl.exe 时出错.
showdlg.obj - 1 error(s), 0 warning(s)
这是所报的错误,和变量类型没有关系。 展开
我用
char *str;
CMainFrame *pMain=(CMainFrame *)AfxGetApp()->m_pMainWnd;
CFileSelectView *pView=(CFileSelectView *)pMain->GetActiveView();
pView->GetDlgItemText(IDC_EDIT1,str);
为什么报错呢?
我加载了头文件。
--------------------Configuration: FileSelect - Win32 Debug--------------------
Compiling...
showdlg.cpp
c:\documents and settings\owner\桌面\vc\复件 fileselect\showdlg.cpp(4) : warning C4652: compiler option 'Generate Browser Info' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
c:\documents and settings\owner\桌面\vc\复件 fileselect\fileselectview.h(28) : error C2143: syntax error : missing ';' before '*'
c:\documents and settings\owner\桌面\vc\复件 fileselect\fileselectview.h(28) : error C2501: 'CFileSelectDoc' : missing storage-class or type specifiers
c:\documents and settings\owner\桌面\vc\复件 fileselect\fileselectview.h(28) : error C2501: 'GetDocument' : missing storage-class or type specifiers
执行 cl.exe 时出错.
showdlg.obj - 1 error(s), 0 warning(s)
这是所报的错误,和变量类型没有关系。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询