我用CSplitterWnd静态切分上面为CScrollView基类,下面为EDITVIEW类。
我在
#include "tiedit.h"
void CScrollView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
.......
Ctiedit stiedit;
stiedit.WriteText(stixian);
......
}
出现
cannot access protected member declared in class 'Ctiedit'
see declaration of 'Ctiedit::Ctiedit'
error C2248: 'Ctiedit::~Ctiedit' : cannot access protected member declared in class 'Ctiedit'
see declaration of 'Ctiedit::~Ctiedit'
error C2819: type 'Ctiedit' does not have an overloaded member 'operator ->'
see declaration of 'Ctiedit'class Ctiedit : public CEditView
{
public:
Ctiedit(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(Ctiedit)
我在
#include "tiedit.h"
void CScrollView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
.......
Ctiedit stiedit;
stiedit.WriteText(stixian);
......
}
出现
cannot access protected member declared in class 'Ctiedit'
see declaration of 'Ctiedit::Ctiedit'
error C2248: 'Ctiedit::~Ctiedit' : cannot access protected member declared in class 'Ctiedit'
see declaration of 'Ctiedit::~Ctiedit'
error C2819: type 'Ctiedit' does not have an overloaded member 'operator ->'
see declaration of 'Ctiedit'class Ctiedit : public CEditView
{
public:
Ctiedit(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(Ctiedit)
解决方案 »
- 帮忙解释一下这段代码(很短)
- CxImage显示图片,内存被持续消耗的问题。
- 创建的cpropertysheet无模式窗口不能进入precreatewindow
- 一起探讨eMule的源码,请加入群,群号为8275753
- 按钮怎么加“图标”,谢谢!
- 需要详细的CMap类的使用?
- 如何建立一个标准的dll,建立后在编写时有什么特殊要求吗?
- 大三学生暑假想到成都找个软件公司实习!!!哪个好心程序员推荐哈我,谢谢!
- 七夕---单身的程序员有多少?
- 0x00406f4指令引用的0x00000014内存该内存不能为read,请教怎么处理,是动态内存分配出现的问题吗?多谢了
- 急啊!!!!!!!!!发传真是不是一定要有调制解调器才行啊?
- 请问高手:如何远程连接服务器上的sql server 7(局域网内),请给出连接例子-我在线等待!
Ctiedit× stiedit;
我改指针编译没错运行到
stiedit.WriteText(stixian);void Ctiedit::WriteText(LPCSTR lpszString)
{
CEdit& Edit = GetEditCtrl();
Edit.SetSel(-1, -1, NULL);
Edit.ReplaceSel(lpszString); //这局不行了
}
你这是在往一个没有窗口的局部变量写文字?
怎么不在CSplitterWnd创建的EDITVIEW上面写?
CSplitterWnd* wnd=(CSplitterWnd*)GetParent();
wnd->SetColumnInfo(0,0,0);
wnd->SetRowInfo(1,50,50);
wnd->GetRowCount();
wnd->SetWindowText(stixian);
也不行啊!我好苦啊!
{
CWnd* pWnd = m_wndSplitter.GetPane(0, 1);
CMyView* pView = DYNAMIC_DOWNCAST(CMyView, pWnd);
return pView;
}