MFC生成SDI应用程序,在MyApp.cpp生成模板后,
// 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;
运行到ProcessShellCommand(cmdInfo)会提示:
Unhandle exception in KITE_debug.exe(MFC042P.DLL):0xC0000005:Access volation请问这个错怎么查啊,因为后面自己加的程序都还没运行呢?

解决方案 »

  1.   

    用step into 跟进去啊
    if (!ProcessShellCommand(cmdInfo)) 里面执行的代码很多的
      

  2.   

    是不是Project Settings中的Program arguments的参数有误啊?
      

  3.   

    我跟踪进出,在
    case CCommandLineInfo::FileNew:
          if (!AfxGetApp()->OnCmdMsg(ID_FILE_NEW, 0, NULL, NULL))
                  OnFileNew();
    然后就死循环出不来了,如果跟踪到里面,就是一堆看不懂的代码了:(
      

  4.   

    在你的CWinApp派生类中增加ID_FILE_NEW的处理代码,只调用CWinApp::OnFileNew继续跟踪