将下面代码 转成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 ;
}
}
功能很简单,就是用FetionVM.exe 来启动autorun.exe,请高手帮忙! 多谢
*启动FetionVM.exe文件,带参数"VMDotNet\\v2.0.50727\\autorun.exe"
*用 ShellExecuteEx 代替
win32:
#include
- 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);
楼上,我用上面的代码运行后报错:
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
#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.
eVC控制台,没用过啊; 建win32程序吧
不知道可不可以写个 批处理文件 来启动。