问题大致上在这个帖子里简单的说过了:
http://community.csdn.net/Expert/topic/3710/3710227.xml?temp=.2474176今天我在另一台机器上(该机器今天格式化,重装的 2000 server)装了同一个版本的 vc6.0.
然后没有安装 visual assist 之类的任何软件。 把原来我那个出错的机器上的程序复制到这个新机器上,打开,当鼠标点击到 -> 前面的时候,IDE 又瞬间退出了我怀疑是项目文件出了问题,然后我重新建项目,添加文件,把程序码复制过来,出现同样的错误。这个程序是 《Programming windows with MFC》 (Jeff Prosise 著) 里面的范例。我按照书中描述的方法一字不差的编写、调试的。
各位请帮我照着实验一下,看是我的环境问题,还是这么做本身有问题。非常感谢!整个程序非常简单, 项目名为 accel, 包含两个文件: accel.h, accel.cpp
按照书中所说的是这么做:先建立一个 win32 application 类型的项目, 下一步选 empty project. 然后到 Project-> Settings -> general 里面把程序的类型改为 "use mfc in a static library"
然后新建 accel.h 和 accel.cpp 并添加到工程。 下面是这两个程序的代码:accel.h
-----------------------------------------#define LINESIZE 8class CMyApp : public CMyApp
{
public:
virtual BOOL InitInstance();
};class CMainWindow : public CFrameWnd
{
protected:
int m_nCellWidth;
int m_nCellHeight;
int m_nRibbonWidth;
int m_nViewWidth; // workspace width in pixels
int m_nViewHeight; // workspace height in pixels
int m_nHScrollPos;
int m_nVScrollPos;
int m_nHPageSize;
int m_nVPageSize;public:
CMainWindow();protected:
afx_msg void OnPaint();
afx_msg int OnCreate(LPCERATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnHScroll(UINT nCode, UINT nPos,
CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nCode, UINT nPos,
CScrollBar* pScrollBar); DECLARE_MESSAGE_MAP()
};
accel.cpp
----------------------------------------------------------------#include <afxwin.h>
#include "accel.h"CMyApp myApp;////////////////////////////////////////////////////////////////
// CMyApp member functionsBOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd
}
这个 cpp 文件是没有输入完毕的。 就是到了最后那一句, 如果你在后面输入 -> 就会退出。
请各位帮忙看看你们那里是不是也这样? 该如何解决?如果能够解决这个问题多少分也行。
http://community.csdn.net/Expert/topic/3710/3710227.xml?temp=.2474176今天我在另一台机器上(该机器今天格式化,重装的 2000 server)装了同一个版本的 vc6.0.
然后没有安装 visual assist 之类的任何软件。 把原来我那个出错的机器上的程序复制到这个新机器上,打开,当鼠标点击到 -> 前面的时候,IDE 又瞬间退出了我怀疑是项目文件出了问题,然后我重新建项目,添加文件,把程序码复制过来,出现同样的错误。这个程序是 《Programming windows with MFC》 (Jeff Prosise 著) 里面的范例。我按照书中描述的方法一字不差的编写、调试的。
各位请帮我照着实验一下,看是我的环境问题,还是这么做本身有问题。非常感谢!整个程序非常简单, 项目名为 accel, 包含两个文件: accel.h, accel.cpp
按照书中所说的是这么做:先建立一个 win32 application 类型的项目, 下一步选 empty project. 然后到 Project-> Settings -> general 里面把程序的类型改为 "use mfc in a static library"
然后新建 accel.h 和 accel.cpp 并添加到工程。 下面是这两个程序的代码:accel.h
-----------------------------------------#define LINESIZE 8class CMyApp : public CMyApp
{
public:
virtual BOOL InitInstance();
};class CMainWindow : public CFrameWnd
{
protected:
int m_nCellWidth;
int m_nCellHeight;
int m_nRibbonWidth;
int m_nViewWidth; // workspace width in pixels
int m_nViewHeight; // workspace height in pixels
int m_nHScrollPos;
int m_nVScrollPos;
int m_nHPageSize;
int m_nVPageSize;public:
CMainWindow();protected:
afx_msg void OnPaint();
afx_msg int OnCreate(LPCERATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnHScroll(UINT nCode, UINT nPos,
CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nCode, UINT nPos,
CScrollBar* pScrollBar); DECLARE_MESSAGE_MAP()
};
accel.cpp
----------------------------------------------------------------#include <afxwin.h>
#include "accel.h"CMyApp myApp;////////////////////////////////////////////////////////////////
// CMyApp member functionsBOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd
}
这个 cpp 文件是没有输入完毕的。 就是到了最后那一句, 如果你在后面输入 -> 就会退出。
请各位帮忙看看你们那里是不是也这样? 该如何解决?如果能够解决这个问题多少分也行。
-------------------是可以。 但是我不服气, 不理解为什么会这样。 难道只能解释为我的人品问题?
可能要重装。