用了很长段时间了,一直好好的,刚才晚上就写了一段,然后运行发生错误中止了,我就来调试,可是发现调试窗口停在汇编代码上面然后发现我不管把光标放在哪里,按执行到光标处,程序都无法运行起来直接运行的话可以运行,但是好像也有些问题~然后我打开其他的MFC的工程,发现都出现这种现象,控制台的程序可以调试页面中止在这里...
003EEE41   add         ebx,ebp
003EEE43   call        CHopeApp::OnLog+155h (00408325)
003EEE48   add         byte ptr [ebx],dh
003EEE4A   jmp         dword ptr [edi+ecx*4+7]
003EEE4E   pop         edi
003EEE4F   call        003EEE54
003EEE54   cmp         eax,67B7h
003EEE59   mov         ebx,dword ptr [esp]
003EEE5C   pop         eax
003EEE5D   sub         ebx,501F028Fh
……(后面不发了)
下面的
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded symbols for 'D:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'D:\WINDOWS\system32\MSVCRTD.DLL'
Loaded 'D:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded symbols for 'D:\WINDOWS\system32\MFCO42D.DLL'
Loaded symbols for 'D:\WINDOWS\system32\MFCD42D.DLL'
Loaded 'D:\WINDOWS\system32\shimeng.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\mfc42loc.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\KB896495.log', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\oleaut32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\wsock32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\wininet.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\crypt32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\msasn1.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\urlmon.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'D:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found.
Loaded 'D:\Program Files\Internet Explorer\PLUGINS\system16.sys', no matching symbolic information found.
First-chance exception in Hope.exe (SYSTEM16.SYS): 0xC0000005: Access Violation.
这是怎么回事?!大家帮我看看

解决方案 »

  1.   

    清除RELEASE或DEBUG目录下的东西,重新编译
      

  2.   

    谢谢楼上的回答~
    说了,所有的MFC工程都出现这个问题~你的方法我试过的,没用哦~
      

  3.   

    刚才试了下,就是到横线上面那个地方不能调试了,横线前面都可以的...BOOL CHopeApp::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(CHopeDoc),
    RUNTIME_CLASS(CMainFrame),       // main SDI frame window
    RUNTIME_CLASS(CHopeView));
    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;
    return TRUE;
    _______________________________________________________<- 到这里出的问题
    //配置数据源
    CString strPassword; if(::GetPrivateProfileString("UserInfo",
                      "System",
                      "",
      strPassword.GetBuffer(10),
      10,
      ".\\info.ini") == 0)
    {
    SetDataResource(); //配置数据源
    //注册system帐户
    CString sq;
    g_dataBase.OpenEx("DSN=MyDataBase");
    sq.Format("Create Table System");
    g_dataBase.ExecuteSQL(sq);
    CString CryptPassword = MyEncrypt("ilovesharline"); 
    ::WritePrivateProfileString("UserInfo",
    "System", 
    CryptPassword,
    ".\\info.ini");
    }//根据system帐户是否存在检测是否配置过
    else
    {
    //初始化CDatabase对象
    g_dataBase.OpenEx("DSN=MyDataBase");
    } CFile file;
    file.Open(".\\cookie.txt" , CFile::modeCreate | CFile::modeNoTruncate | CFile::modeRead);
    int nCount = file.GetLength();
    if(nCount>0)
    {
    char* pb;
    pb = new char [20];
    file.Read(pb, nCount);
    pb[nCount]='\0';
    CString str(pb);
    g_loginName =str;
    m_bCookie=TRUE;
    SetMenu();
    delete pb;
    }
    file.Close();    //CryptAPI初始化
    CryptInitial(); g_imageList.Create(106,64, 0, PICTURENUM, PICTURENUM);
    hBmp[0].LoadBitmap(IDB_BITMAP0);//(IDB_SPACE);
    hBmp[1].LoadBitmap(IDB_BITMAP4);
    hBmp[2].LoadBitmap(IDB_BITMAP2);
    hBmp[3].LoadBitmap(IDB_BITMAP5);
    hBmp[4].LoadBitmap(IDB_BITMAP6);
    hBmp[5].LoadBitmap(IDB_BITMAP8);
    hBmp[6].LoadBitmap(IDB_BITMAP9);
    hBmp[7].LoadBitmap(IDB_BITMAP10);
    hBmp[8].LoadBitmap(IDB_BITMAP11);
    hBmp[9].LoadBitmap(IDB_BITMAP12);
    hBmp[10].LoadBitmap(IDB_BITMAP13);
    hBmp[11].LoadBitmap(IDB_BITMAP14);
    hBmp[12].LoadBitmap(IDB_BITMAP15);
    hBmp[13].LoadBitmap(IDB_BITMAP16);
    hBmp[14].LoadBitmap(IDB_BITMAP17);
    hBmp[15].LoadBitmap(IDB_BITMAP18); for(int i=0; i<PICTURENUM; i++)
    {
    g_imageList.Add(&hBmp[i], RGB(0, 0, 0));
    }
    // The one and only window has been initialized, so show and update it.
    m_pMainWnd->ShowWindow(SW_SHOW);
    m_pMainWnd->UpdateWindow();}
      

  4.   

    那是不是你工程设置为Release模式了??
    而不是Debug模式~~
      

  5.   

    if  (!ProcessShellCommand(cmdInfo))  
                           return  FALSE;  
               return  TRUE;  
    这里确实有问题啊,怎么都返回呢?下面的就执行不到了。