且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么CreateProcess给出错误193(%1不是有效的Win32应用程序)

更新时间:2022-06-02 17:49:23

该错误的最有可能的解释是: p>

The most likely explanations for that error are:


  1. 您尝试加载的文件不是可执行文件。 CreateProcess 要求您提供可执行文件。如果您希望能够使用相关应用程序打开任何文件,那么您需要 ShellExecute 而不是 CreateProcess

  2. 加载可执行文件的依赖关系之一是一个问题,即链接到可执行文件的DLL。最常见的原因是32位可执行文件和64位DLL之间的不匹配,反之亦然。要调查,请使用 Dependency Walker的配置文件模式,以准确检查出现的错误。 / li>
  1. The file you are attempting to load is not an executable file. CreateProcess requires you to provide an executable file. If you wish to be able to open any file with its associated application then you need ShellExecute rather than CreateProcess.
  2. There is a problem loading one of the dependencies of the executable, i.e. the DLLs that are linked to the executable. The most common reason for that is a mismatch between a 32 bit executable and a 64 bit DLL, or vice versa. To investigate, use Dependency Walker's profile mode to check exactly what is going wrong.

阅读底部的代码,我可以看到问题是数字1。

Reading down to the bottom of the code, I can see that the problem is number 1.