简单问题求救(明天补给分)

青天   2008-7-1 11:15 楼主
将下面代码 转成embedded vc++ 4.0环境下的代码,我不懂c++,请高手帮个忙!
#using
#using

using namespace System;
using namespace System::Collections::Generic;


void main()
{
    //???????÷?????????ò???ú??
    System::Diagnostics::ProcessStartInfo^ Info = gcnew System::Diagnostics::ProcessStartInfo();
    Info->FileName = "VMDotNet\\v2.0.50727\\FetionVM.exe";  
    Info->Arguments = "VMDotNet\\v2.0.50727\\autorun.exe";
    System::Diagnostics::Process^ Proc = nullptr;

    try
    {
        //
        //???????????ò
        //
        Proc = System::Diagnostics::Process::Start(Info);
    }
    catch (System::ComponentModel::Win32Exception^ e)
    {
        Console::WriteLine("系统找不到指定的程序文件。\r{0}", e);
        return ;
    }
}

回复评论 (5)

功能很简单,就是用FetionVM.exe 来启动autorun.exe,请高手帮忙! 多谢
点赞  2008-7-1 11:16
*启动FetionVM.exe文件,带参数"VMDotNet\\v2.0.50727\\autorun.exe"
*用 ShellExecuteEx 代替
win32:
#include


  1.         SHELLEXECUTEINFO ef;
  2.         memset(&ef,0,sizeof(SHELLEXECUTEINFO));
  3.         ef.cbSize=sizeof(SHELLEXECUTEINFO);
  4.         ef.fMask=SEE_MASK_NOCLOSEPROCESS;
  5.         ef.hwnd=NULL;
  6.         ef.lpVerb=NULL;
  7.         ef.lpFile=TEXT("VMDotNet\\v2.0.50727\\FetionVM.exe");
  8.         ef.lpParameters=TEXT("VMDotNet\\v2.0.50727\\autorun.exe");
  9.         ef.nShow=SW_HIDE;
  10.         ef.hInstApp=NULL;
  11.         ShellExecuteEx(&ef);
点赞  2008-7-1 13:02
楼上,我用上面的代码运行后报错:

C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Include\emulator\Shellapi.h(37) : error C2501: 'HICON' : missing storage-class or type specifiers
C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Include\emulator\Shellapi.h(37) : fatal error C1004: unexpected end of file found
点赞  2008-7-1 15:04
#include

void Main()
{
        SHELLEXECUTEINFO ef;
    memset(&ef,0,sizeof(SHELLEXECUTEINFO));
    ef.cbSize=sizeof(SHELLEXECUTEINFO);
    ef.fMask=SEE_MASK_NOCLOSEPROCESS;
    ef.hwnd=NULL;
    ef.lpVerb=NULL;
    ef.lpFile=TEXT("VMDotNet\\v2.0.50727\\FetionVM.exe");
    ef.lpParameters=TEXT("VMDotNet\\v2.0.50727\\autorun.exe");
    ef.nShow=SW_HIDE;
    ef.hInstApp=NULL;
    ShellExecuteEx(&ef);


}

运行后报错

Compiling...
start.cpp
c:\program files\windows ce tools\wce420\pocket pc 2003\include\armv4\shellapi.h(37) : error C2146: syntax error : missing ';' before identifier 'WINAPI'
c:\program files\windows ce tools\wce420\pocket pc 2003\include\armv4\shellapi.h(37) : error C2501: 'HICON' : missing storage-class or type specifiers
c:\program files\windows ce tools\wce420\pocket pc 2003\include\armv4\shellapi.h(37) : fatal error C1004: unexpected end of file found
Error executing clarm.exe.
点赞  2008-7-1 15:41
eVC控制台,没用过啊; 建win32程序吧

不知道可不可以写个 批处理文件 来启动。
点赞  2008-7-1 17:31
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复