老C++程序调试出错,急求解决!
2005年的老程序,有源码,但是没有其他任何文档资料。改了一点东西在本地XP虚拟机的VC6环境下编译调试都通过,EXE文件可执行,无任何压力,但是把EXE文件覆盖到服务器上运行,服务器为win2003企业版,点击EXE打开窗口就报错,错误截图如下:
后来在服务器上安装VC6,把原始工程拷贝到服务器上调试执行一样报错,但是本地XP虚拟机毫无压力,由于本人从事JAVA开发,对C++可以说是门外汉,已经网络搜索错误解决方法一直没法解决,大多数都说这种错误是代码问题,变量初始化等等原因,但是调试跟踪的那段代码都没有动过。
如果看不到图,文字描述错误:
打开窗口,弹出错误提示:Debug Assertion Failed!From:定位在EXE文件,File:afxwin2.inl,Line:96,堆栈里面定位的代码片段如下(看起来好像是VC自动生成的):
BOOL CMsgDispatcherApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls();// Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic();// Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMsgDispatcherDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
//RUNTIME_CLASS(CReChargeGwView));
RUNTIME_CLASS(CMessageView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}