PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8037 Location: Salford, UK
|
Posted: Mon Dec 15, 2008 1:01 pm Post subject: Using ClearWin+ under .NET |
|
|
FTN95 for .NET has its own GUI interface called Visual ClearWin. Never-the-less some users may prefer to use the more familiar and more accessible ClearWin+.
The following sample code illustrates how to access many of the features of ClearWin+ from a .NET Fortran program. We cannot guarantee that all aspects of ClearWin+ will port to .NET but you may wish to test your existing code and report back any simple failures.
The primary limitation of ClearWin+ under .NET is the need to place any resources in a Win32 DLL.
For illustration, create a file called resources.f90 containing the following code...
Code: |
subroutine dummy()
end
resources
mypicture BITMAP "copy.bmp" |
Compile and link this file using the command line
Code: | FTN95 resources.f90 /link resources.dll |
Now create a file called test.f90 containing...
Code: | WINAPP
include <windows.ins>
integer i,cb,L
external cb
L=LoadLibrary("c:\techsupport\resources.dll")
call use_resource_library@("c:\techsupport\resources.dll")
i=winio@("%bm[mypicture] %^bt[OK]",cb)
end
integer function cb()
cb = 0
end
|
Compile and link this file using the command line
Code: | FTN95 test.f90 /clr /link |
Now run the executable. You will need to provide your own bitmap file instead of copy.bmp and also you will use the name of your own folder instead of c:\techsupport.
Note that it is necessary to include windows.ins rather than employ the USE statement for the corresponding module. At the moment we do not distribute standard modules for .NET but these could be provided if there is a demand.
In a future release of salflibc.dll you will not need to call LoadLibrary. ClearWin+ resides in this Win32 DLL and is not portable to other .NET environments unless they also allow access to Win32 DLLs. |
|