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

BasicQuestion MessageBox.Show C# equivalent ? in Visual Fortran 9

oren_sternberg
Beginner
1,740 Views
Hi

I was wandering if there is a simple way to show text pop up
like a MessageBox.Show command as a function of click button on a form.

if (callbacktype == dlg_clicked) then

! ? command

endif


Regards,

Oren
0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,740 Views
Calling the Win32 API routine MessageBox is pretty simple.
0 Kudos
oren_sternberg
Beginner
1,740 Views

Can you show me an example of an hello world popup (messagebox)

0 Kudos
Steven_L_Intel1
Employee
1,740 Views
program helloworld
use ifwin
implicit none
integer(SINT) :: ret

ret = MessageBox ( &
        GetForegroundWindow(), & ! Handle to window
        "Hello, world!"C, & ! Text (don't forget C-string)
        "Example of using MessageBox"C, & ! Caption for title bar
        MB_ICONINFORMATION + MB_OK) ! Type flags
end program helloworld

Message Edited by Steve_Lionel on 05-15-2006 04:34 PM

0 Kudos
oren_sternberg
Beginner
1,740 Views
Thanks it works well for my old f90 program, if I run as a console application
Is therea reason why I get this error below for the same code in run it as a winapp.
Is there a better way to produce the same results with an internal instruction
Oren
WinApp4 error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
0 Kudos
Steven_L_Intel1
Employee
1,740 Views
If you want to build a program as a "Windows Application", it needs to be structured as one. You can't take a simple console application and just rebuild it as a Windows application. Please read the section in the Building Applications manual on the different project types.

I don't understand your second question.
0 Kudos
Reply