先要找到这个View的指针pView
比如是SDI的程序,可以很简单地写出:
void CMainFrame::ExampleFunc()
{
CMyView *pView=(CMyView*)GetDescendantWindow(AFX_IDW_PANE_FIRST);
ASSERT_KINDOF(pView,CMyView);
pView->GetDC()->TextOut(10,10,"hello,world");
}
比如是SDI的程序,可以很简单地写出:
void CMainFrame::ExampleFunc()
{
CMyView *pView=(CMyView*)GetDescendantWindow(AFX_IDW_PANE_FIRST);
ASSERT_KINDOF(pView,CMyView);
pView->GetDC()->TextOut(10,10,"hello,world");
}
解决方案 »
- view显示的问题
- CProgressCtrl显示我处理进度,但文件150多M,进度的用来表示字节无法表示!因为是一个INT型的范围。
- 懂的C++与汇编的进
- GSM 设备实现短信发送与接收
- 请教 怎样有效的插入三四十个字段值?
- 问一个很弱的问题:V2005下怎么编译C++源文件呀?
- 谁能推荐一个有关界面皮肤方面编程的地方
- 考,今天面试。被一道题郁闷了。请那位帮忙解个答
- 为什么在crystal Reports 8下写的程序,在crystal Reports 9下却编译不过去了??请帮忙看看。
- 【求指教】CExplorer1 消息截获
- 怪!!!为什么CString有255个长度的限制???
- 能否修改电脑的接收网络信息的缓冲区大小?
pView ->GetEditCtrl().SetWindowText( "sometext" );
pView->SetWindowText("Your text goes here");
在MainFrame.cpp中使用如下代码:
CWCCSView *pView=(CWCCSView *)GetActiveView();
pView->GetEditCtrl().SetWindowText("asdfasdfdsafa"); 其中CWCCSView *pView=(CWCCSView *)GetActiveView();可以编译通过
但pView->GetEditCtrl().SetWindowText("asdfasdfdsafa"); 会出现以下错误:error C2027: use of undefined type 'CWCCSView' see declaration of 'CWCCSView'
error C2227: left of '->GetEditCtrl' must point to class/struct/union
error C2228: left of '.SetWindowTextA' must have class/struct/union type望指教