在Pocket PC模拟器应用程序上调用.exe文件的未处理异常

时间:2011-05-15 22:26:01

标签: c# visual-studio-2005 pocketpc unhandled-exception

我正试图在Pocket 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#

1 个答案:

答案 0 :(得分: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();
}