Code works in XP but fails in Windows 7

Code works in XP but fails in Windows 7

Hi All,

The following works fine in Windows XP:

bret = CreateProcess(null,"C:\\WQA\\WQA updating\\wqafinder.exe"C,null,null,false,CREATE_NO_WINDOW,null,null,si,pi)

But in Windows 7 it fails. GetLastError() indicates error 193, "%1 is not a valid Win32 application". I am using Intel Visual Fortran Composer XE 2013 with Win32 configuration set for both the program containing the above line, and the target program (wqafinder.exe). Please can someone throw some light on what's wrong?

Many thanks in advance,

Mike

5 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

What happens when you use a CMD window and type in a command to run the program?

Is wqafinder.exe a program you wrote?

Jim Dempsey

 

www.quickthreadprogramming.com

I'll bet that wqafinder.exe is a 16-bit program. These will run on XP but not on Windows 7 x64. The problem has nothing at all to do with Intel Fortran.

Steve - Intel Developer Support

Thanks for replies. The program wqafinder is a 32 bit program and it runs well when started from a command window in Windows 7. But Steve's comment gave me clue - the documentation for CreateProcess says the first argument, lpApplicationName, should be null for 16 bit applications (though it doesn't say it should not be null for 32 bit applications). Anyway, I changed the first and second arguments around and it all works well now.

Many thanks

Mike

Sometimes when in I am in doubt about the functionality of some Win API function(s) I look at their implementation here I mean mainly input parameters processing.The implementation can be found in ReactOS code source.But I would not relay on their decompilation because it is mainly based on Win 2k/Win XP code.

发表评论

登录添加评论。还不是成员?立即加入