robotsimu.exe中0x5e17a072(mfc110d.dll)的未处理异常:0xc0000005:访问冲突读取位置0x00000000。 [英] Unhandled exception at 0x5e17a072 (mfc110d.dll) in robotsimu.exe: 0xc0000005: access violation reading location 0x00000000.

查看:152
本文介绍了robotsimu.exe中0x5e17a072(mfc110d.dll)的未处理异常:0xc0000005:访问冲突读取位置0x00000000。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.

#include "stdafx.h"
#include "sal.h"


/////////////////////////////////////////////////////////////////////////////
// Standard WinMain implementation
//  Can be replaced as long as 'AfxWinInit' is called first

int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
	_In_ LPTSTR lpCmdLine, int nCmdShow)
{
	ASSERT(hPrevInstance == NULL);

	int nReturnCode = -1;
	CWinThread* pThread = AfxGetThread();
	CWinApp* pApp = AfxGetApp();

	// AFX internal initialization
	if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
		goto InitFailure;

	// App global initializations (rare)
	if (pApp != NULL && !pApp->InitApplication())
		goto InitFailure;

	// Perform specific initializations
	if (!pThread->InitInstance())
	{
		if (pThread->m_pMainWnd != NULL)
		{
			TRACE(traceAppMsg, 0, "Warning: Destroying non-NULL m_pMainWnd\n");
			pThread->m_pMainWnd->DestroyWindow();
		}
		nReturnCode = pThread->ExitInstance();
		goto InitFailure;
	}
	nReturnCode = pThread->Run();

InitFailure:
#ifdef _DEBUG
	// Check for missing AfxLockTempMap calls
	if (AfxGetModuleThreadState()->m_nTempMapLock != 0)
	{
		TRACE(traceAppMsg, 0, "Warning: Temp map lock count non-zero (%ld).\n",
			AfxGetModuleThreadState()->m_nTempMapLock);
	}
	AfxLockTempMaps();
	AfxUnlockTempMaps(-1);
#endif

	AfxWinTerm();
	return nReturnCode;
}

/////////////////////////////////////////////////////////////////////////////




我尝试过:



破解从这一行开始:



if(!pThread-> InitInstance())

{

if(pThread-> m_pMainWnd!= NULL)

{

TRACE(traceAppMsg,0,警告:销毁非NULL m_pMainWnd \ n);

pThread-> m_pMainWnd-> DestroyWindow();

}

nReturnCode = pThread-> ExitInstance();

goto InitFailure;

}

nReturnCode = pThread-> Run();



你知道的含义是什么这个RobotSimu.exe中0x5E17A072(mfc110d.dll)的未处理异常:0xC0000005:访问冲突读取位置0x00000000?



What I have tried:

The "break" starts from this line :

if (!pThread->InitInstance())
{
if (pThread->m_pMainWnd != NULL)
{
TRACE(traceAppMsg, 0, "Warning: Destroying non-NULL m_pMainWnd\n");
pThread->m_pMainWnd->DestroyWindow();
}
nReturnCode = pThread->ExitInstance();
goto InitFailure;
}
nReturnCode = pThread->Run();

Do you know what the meaning of this "Unhandled exception at 0x5E17A072 (mfc110d.dll) in RobotSimu.exe: 0xC0000005: Access violation reading location 0x00000000" ?

推荐答案

发布的代码是默认实现MFC winmain.cpp 源文件。



如果在那里发生访问冲突,你可能在你的 CWinApp 派生类的一个或一个 InitInstance()中出错了在那里调用你自己的函数。



常见错误是使用 m_pMainWnd 而不将其设置到主窗口(主框架主对话窗口)。默认情况下用 NULL 初始化,当你想使用它时必须用代码设置。
The posted code is the default implementation from the MFC winmain.cpp source file.

If an access violation occurs there, you probably made something wrong in InitInstance() of your CWinApp derived class or one of your own functions called there.

A common error is using m_pMainWnd without setting it to the main window (main frame resp. main dialog window). That is initialised with NULL by default and must be set by code when you want to use it.


这意味着空指针是被解除引用。它可能是pThread变量,因为它是您包含的代码段中的主要指针。 m_pMainWnd是另一种可能性,但有逻辑检查。
It means a null pointer was being dereferenced. It was likely the pThread variable since that is the main pointer in the snippet you included. m_pMainWnd is another possibility but there is logic checking for that.


这篇关于robotsimu.exe中0x5e17a072(mfc110d.dll)的未处理异常:0xc0000005:访问冲突读取位置0x00000000。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆