Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28386 Discussions

Code works in XP but fails in Windows 7

michael_green
Beginner
246 Views

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

0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
246 Views

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

 

0 Kudos
Steven_L_Intel1
Employee
246 Views

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.

0 Kudos
michael_green
Beginner
246 Views

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

0 Kudos
Bernard
Valued Contributor I
246 Views

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.

0 Kudos
Reply