0

我正在尝试在袖珍 PC 模拟器上的 vc2005 上运行此代码,但它给了我一个 win32unhandled 异常

private void button1_Click(object sender, EventArgs e)
{ 
  System.Diagnostics.Process Proc = new System.Diagnostics.Process();
  Proc.StartInfo.FileName = @"WM_flowm.exe";
  Proc.Start();
}

WM_flowm.exe 是可以在 windows mobile 上毫无问题地运行的 flite tts,但我需要在我的 C# 代码中调用它。

调用堆栈

System.dll!System.Diagnostics.Process.StartWithShellExecuteEx(System.Diagnostics.ProcessStartInfo startInfo = {System.Diagnostics.ProcessStartInfo}) + 0xcb bytes   

System.dll!System.Diagnostics.Process.Start() + 0x3f bytes  

停在这里===

try_DLL.exe!try_DLL.Form1.button1_Click(object sender = {Text = "button1"}, System.EventArgs e = {System.EventArgs}) 第 29 行 + 0x6 字节 C#

System.Windows.Forms.dll!System.Windows.Forms.Control.OnClick(System.EventArgs e = {System.EventArgs}) + 0x15 bytes 

System.Windows.Forms.dll!System.Windows.Forms.Button.OnClick(System.EventArgs e = {System.EventArgs}) + 0x32 bytes  

System.Windows.Forms.dll!System.Windows.Forms.ButtonBase.WnProc(Microsoft.AGL.Forms.WM wm = WM_BUTTON_NOTIFYCLICKED, int wParam = 0, int lParam = 0) + 0x17 bytes   

System.Windows.Forms.dll!System.Windows.Forms.Control._InternalWnProc(Microsoft.AGL.Forms.WM wm = WM_BUTTON_NOTIFYCLICKED, int wParam = 0, int lParam = 0) + 0x9 bytes  

System.Windows.Forms.dll!Microsoft.AGL.Forms.EVL.EnterMainLoop(System.IntPtr hwnMain = 1114117) 

System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form fm = {try_DLL.Form1}) + 0x1a bytes  

try_DLL.exe!try_DLL.Program.Main() Line 15 + 0xa bytes  C#
4

1 回答 1

0

尝试使用文件的完整路径。如果文件位于 \Progam Files\WM_Flowm\:

private void button1_Click(object sender, EventArgs e)
{ 
    System.Diagnostics.Process Proc = new System.Diagnostics.Process();
    Proc.StartInfo.FileName = @"\Program Files\WM_flowm\WM_flowm.exe";
    Proc.Start();
}
于 2011-05-17T15:56:05.630 回答