我已经在里面添加了,可是在里面输入任何字符或数字都会发生异常,为什么
m_command.AddView(_T("Command"),RUNTIME_CLASS(CMyView));class CMyView : public CHiliteEditView
{
protected:
DECLARE_DYNCREATE(CMyView)
public:
CMyView();
public: public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
protected:
DECLARE_MESSAGE_MAP()
};class CHiliteEditView : public CEditView
{
protected:
CHiliteEditView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CHiliteEditView)public:
int GetCaretLine() const; // return current caret line number
void GetLineRect(int nLine, LPRECT lpRect) const;
public:
public:
virtual void OnInitialUpdate();
virtual void DrawCaretLine(BOOL bInPaint = FALSE);protected:
virtual ~CHiliteEditView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
CSize m_sizeChar;
CFont m_fontDefault;
BOOL m_bCanPaint;
int m_nCaretLine;
protected:
afx_msg void OnPaint();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
m_command.AddView(_T("Command"),RUNTIME_CLASS(CMyView));class CMyView : public CHiliteEditView
{
protected:
DECLARE_DYNCREATE(CMyView)
public:
CMyView();
public: public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
protected:
DECLARE_MESSAGE_MAP()
};class CHiliteEditView : public CEditView
{
protected:
CHiliteEditView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CHiliteEditView)public:
int GetCaretLine() const; // return current caret line number
void GetLineRect(int nLine, LPRECT lpRect) const;
public:
public:
virtual void OnInitialUpdate();
virtual void DrawCaretLine(BOOL bInPaint = FALSE);protected:
virtual ~CHiliteEditView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
CSize m_sizeChar;
CFont m_fontDefault;
BOOL m_bCanPaint;
int m_nCaretLine;
protected:
afx_msg void OnPaint();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
解决方案 »
- 求教 BitBlt用小图块贴全图方法
- 看似一点问题也没有啊,谁来帮我看看,不到20行的程序。。。。
- 做一个编辑器,在编辑的时候想实现类似Word"视图"菜单中的"页面"功能。大家给点思路!!
- 为什么用spy++和EnumChildWindow都无法取得像泡泡堂这样的全屏游戏中的用户名与密码等控件的句柄呢???
- 求助:MFC, fatal error C1001: INTERNAL COMPILER ERROR
- 如何通过注册表纪录对话框的位置(急)
- 如何清楚listbox空白项?
- sos!急,在线等,高手请进
- VS2008 CComboBox添加下拉列表框失败!
- 为什么我发到应用程序的字符串都是乱码?
- typedef下ATL的CString为String,链接警告
- 【版务贴】为了响应happyparrot大版主的号召,本周开始,逐渐对VC/MFC-图形处理/算法版超过一个月没有回复的帖子进行强制结贴!请大家自觉结贴!
#endif /* WPRFLAG */
(HINSTANCE)&__ImageBase,
NULL,
lpszCommandLine,
StartupInfo.dwFlags & STARTF_USESHOWWINDOW
? StartupInfo.wShowWindow
: SW_SHOWDEFAULT
在这里中断了