各位大侠是这么一回事。我的程序点击一菜单,执行一个功能,
在BEGIN_MESSAGE_MAP 中就有
   ON_COMMAND(ID_OPERATION_GO, OnOperationGo)来执行OnOperationGo()。我需要实现命令行" MyTest.exe /go"
当知道有go参数时,它自动执行OnOperationGo() 函数.
请给俺指点迷津。

解决方案 »

  1.   

    GetCommandLine
    The GetCommandLine function returns a pointer to the command-line string for the current process. LPTSTR GetCommandLine(VOID)
     
    Parameters
    This function has no parameters. Return Values
    The return value is a pointer to the command-line string for the current process. 
      

  2.   

    awant2k(一点通) , 用GetCommandLine()放在哪个cpp文件,哪一个函数中才行。
    我试了几个,执行出错。估计是view、document、windows等对象都还未初始化完。
    我猜想是发一个消息,但不知道菜单被点击后,是发什么样的消息。
      

  3.   

    突然有个问题LPTSTR GetCommandLine(VOID),这个函数返回的是一个字符串指针那这个指针所指的这段内存空间由谁来释放呢! 由程序员来释放?