在袖珍电脑模拟器应用程序上调用 .exe 文件时出现未处理的异常

发布于 2024-11-07 09:33:14 字数 1695 浏览 4 评论 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 是 flite tts,可以在 Windows Mobile 上运行而没有问题,但我需要在我的 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#

I'm trying to run this code on vc2005 on pocket PC emulator but it gives me a win32unhandled exception

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

The WM_flowm.exe is the flite tts which can run on windows mobile without problems, but I need to call it in my C# code.

the call stack

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

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

stopped here ===

try_DLL.exe!try_DLL.Form1.button1_Click(object sender = {Text = "button1"}, System.EventArgs e = {System.EventArgs}) Line 29 + 0x6 bytes 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#

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他不在意 2024-11-14 09:33:15

尝试使用文件的完整路径。如果文件位于 \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();
}

Try using the full path of the file. If the file is in \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();
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文