MRISegmentation.exe中0x0435A072(mfc110d.dll)的第一次机会异常:0xC0000005:访问冲突读取位置0x00000000

时间:2018-05-17 18:01:54

标签: c++ visual-studio mfc

我已将visual studio 10程序转换为visual studio 12.该程序已成功构建但当我尝试运行它时。如果(!pThread-> InitInstance())在这里我收到错误。 pThread为空。

我试图搜索它所在的点。但我不知道每次我试图调试它,它直接转到winmain.cpp并获得pThread null错误。我在这里发布我的主文件和头文件的代码。

#include "stdafx.h"
#include "MRISegmentation.h"
#include "MRISegmentationDlg.h"

 #ifdef _DEBUG
 #define new DEBUG_NEW
 #endif


     // CMRISegmentationApp

 BEGIN_MESSAGE_MAP(CMRISegmentationApp, CWinApp)
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  END_MESSAGE_MAP()


 // CMRISegmentationApp construction

 CMRISegmentationApp::CMRISegmentationApp()
  {


// TODO: add construction code here,
// Place all significant initialization in InitInstance
}


// The one and only CMRISegmentationApp object

CMRISegmentationApp theApp;

// CMRISegmentationApp initialization

BOOL CMRISegmentationApp::InitInstance()

{    
InitCommonControls();

CWinApp::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
// 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"));

CMRISegmentationDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
    // TODO: Place code here to handle when the dialog is
    //  dismissed with OK
}
else if (nResponse == IDCANCEL)
{
    // TODO: Place code here to handle when the dialog is
    //  dismissed with Cancel
}

// Since the dialog has been closed, return FALSE so that we exit the
//  application, rather than start the application's message pump.
return FALSE;
 }

 And the header file  "MRISegmentation.h" is below

 #pragma once

#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h"       // main symbols


// CMRISegmentationApp:
// See MRISegmentation.cpp for the implementation of this class
//

class CMRISegmentationApp : public CWinApp
{
public:
CMRISegmentationApp();

 // Overrides
public:
virtual BOOL InitInstance();

 // Implementation

DECLARE_MESSAGE_MAP()
 };

 extern CMRISegmentationApp theApp;

0 个答案:

没有答案