将一个文件的与我的MFC程序进行关联,也可以打开我的MFC软件,但我要如何将文件中的内容在打开MFC软件的时候加载到MFC软件中?程序在运行起来时如何进行判断这是程序时我双击快捷方式打开的,还是双击相关文件打开的?

解决方案 »

  1.   

    WINmain函数的
    lpCmdLine可以判断程序的打开方式。
    也可调用GetCommandLine函数获取。
      

  2.   

    标准向导生成的 
    CXXXApp:: 
      

  3.   

    标准向导生成的 
    CXXXApp:: InitInstance 中的 // 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; 
      

  4.   

    exe加载MFC
      

  5.   

    搜“Shell Extension”?