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

Dialog Question

daday
Beginner
675 Views
I have a modal dialog application that works like a calculator. It was developed on a system running Windows 2000 with CVF 6.1A, as a WIN32 program. The application works fine, but when it is run it appears to want to be open in a context with the DOS screen as a background. I would like to be able to minimize or close this background screen, but the only way I have found to do it is with the Windows PIF editor and I suspect that this is not very portable. Does anyone have any suggestions?
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
675 Views
That's because you created a "Fortran Console Application". From your description, you don't need a console at all. So, instead, you need a "Fortran Windows Application" -- this one creates only windows that you tell it to.

Best, create a new workspace of type Fortran Windows Application. Select "Empty windows application" in the wizard; insert your old .for/.f90 file and just replace PROGRAM...END PROGRAM statements with
INTEGER FUNCTION WinMain(hI, hPI, lpszCL, nShow)
!DEC$ATTRIBUTES STDCALL, ALIAS: "_WinMain@16":: WinMain
INTEGER:: hI, hPI, lpszCL, nShow
...
END FUNCTION WinMain


Jugoslav
0 Kudos
daday
Beginner
675 Views
Thank you very much. The program works now as I had hoped it would, although the linker prints a warning that the return value for the WinMain function has not been defined. Can I just ignore this?
0 Kudos
Steven_L_Intel1
Employee
675 Views
No - add:

WinMain = 0

Before the RETURN or END.

Steve
0 Kudos
daday
Beginner
675 Views
I added the statement, and now get no warning. Thanks a lot.
0 Kudos
Reply