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

dfwin message box not displayed in debug build

David_Mccabe
Beginner
872 Views

the following code only seems to produce a winapi message box when built in release mode:

[FORTRAN]

program test

 use dfwin

 integer :: button

 integer :: hOwner

 button = Messagebox(hOwner,"press ok..."//char(0),"test"//char(0),MB_OK)

end program test 

[/FORTRAN]

Is there anyway to output a message box in debug mode?

 

Thanks

 

0 Kudos
3 Replies
dboggs
New Contributor I
872 Views
You didn't say what kind of project you're building, but with "use dfwin" I presume it is a Quickwin app. In this case you can use MESSAGEBOXQQ which you may find slightly easier to use and better behaved. btw, you should now use IFQWIN instead of the older DFWIN. You can also simplify the null-terminated strings, e.g. 'test'C is equivalent to 'test'//char(0)
0 Kudos
IanH
Honored Contributor III
872 Views
The variable hOwner is undefined when you call MessageBox. Define it to be something meaningful - 0 perhaps.
0 Kudos
David_Mccabe
Beginner
872 Views
Thank you both. Messagebox is displayed after setting hOwner to 0. I will use IFQWIN from now on.
0 Kudos
Reply