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 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

 

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.

Retired 12/31/2016

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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today