Исключение первого шанса в 0x0435A072 (mfc110d.dll) в MRISegmentation.exe: 0xC0000005: расположение чтения нарушения доступа 0x00000000 - PullRequest
0 голосов
/ 17 мая 2018

Я преобразовал программу visual studio 10 в visual studio 12. Программа успешно скомпонована, но когда я попытался ее запустить.Я получаю сообщение об ошибке, если (! PThread-> InitInstance ()) здесь.pThread is null.

Я попытался найти точку, откуда она вызывается.Но я не знаю, каждый раз, когда я пытался отладить его, он шел прямо в winmain.cpp и получал пустую ошибку pThread.Я публикую код моего основного файла и файла заголовка здесь.

#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;
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...