It seems that Visual Studio does not allow the user to compile/build individual source files if they are not playing some kind of role in the more general project solution (One would have to create, compile and build a separate project for each tiny Fortran program). I am however restricted to the two applications above for reasons not relevant to discuss here. This would be similar to using a basic Fortran compiler such as GNU and running things like "hello world" type programs through the command prompt. My objective is to come up with a simple construct/framework in which I can generate and test basic Fortran programs/output in order to learn the Fortran language. I am familiar with neither the use of Microsoft Visual Studio nor Fortran as a programming language in general. Dialog boxes require the use of a resource editor to define the dialog, and then code to display the dialog window, wait for input, and then process the user's choices.I have recently acquired a copy of Microsoft Visual Studio 2012 and Intel Parallel Studio Visual Fortran Compiler XE 2013. Your sample code shows only a message box, which is NOT a dialog. The sample Dialog\WHIZZY illustrates many controls using this. Intel Fortran also provides a more Fortran-friendly dialog box library which can handle a lot of what you need. Do keep in mind that the WinAPI calls are all STDCALL (on 32-bit), so make sure whichever interfaces you are using specify that. This should translate well (other than module names) to other compilers. For pure API calls, the Win32\Angle sample contains a dialog text box that it reads from, so you can study that. Intel Visual Fortran has modules and also a bunch of examples that can be downloaded as part of the Intel Parallel Studio XE for Windows Samples Bundle - see the compiler_f subfolder of that. It would help if you specified which Fortran compiler you're using, as some include Windows API definition modules and other helpful items. Ret = MessageBox( GetForegroundWindow(), message, dlg_title, MB_ICONQUESTION MB_OKCANCEL )īut, I don't know how to make a dialog box to gather user input (e.g., number or text), like following attached image, by calling Win32 APIs (or other ways) from Fortran.ĭoes anyone have good idea for this purpose? It will be really appreciated if you share some wisdom (e.g., example code). Write(*,*) OKCancelDialog( "Continue?"//achar(0), "Test dialog"//achar(0) )įUNCTION OkCancelDialog( message, dlg_title ) RESULT( res )Ĭharacter( len = * ), intent( in ) :: messageĬharacter( len = * ), intent( in ) :: dlg_title For example, I have succeeded to make a simple "OK/Cancel" dialog as shown below. I am trying to make a Fortran code showing some dialog box for Windows environments.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |