forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using ClearWin+ under .NET

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    forums.silverfrost.com Forum Index -> KBase
View previous topic :: View next topic  
Author Message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5044
Location: Salford, UK

PostPosted: Mon Dec 15, 2008 1:01 pm    Post subject: Using ClearWin+ under .NET Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    forums.silverfrost.com Forum Index -> KBase All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group