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 

Delayed binding of DLL's with SLINK
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Thu Sep 02, 2010 7:37 am    Post subject: Reply with quote

Hi Paul,

thanks for your answers!

Nevertheless you should try to implement this feature to the next FTN version.

As you can see, other compilers do support delayed binding of DLL's, and also your website is promising something like that.

Our management requires this feature for our application and maybe they will force us to change to another compiler (that really means: goodby Silverfrost).

Detlef
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Thu Sep 02, 2010 9:07 am    Post subject: Reply with quote

If by "delayed binding" we mean the equivalent of LoadLibrary/GetProcAddress then FTN95 does not provide this in a direct way. I will pass this to the website manager for clarification.

You can call both LoadLibrary and GetProcAddress from FTN95 and the result will be an integer which is a function pointer. It would be interesting to see what would happen if you passed this integer to a subprogram that is expecting a function as an argument. Given some work-around of this kind, you would need to provide such a wrapper for every call to the dll.

If you do find an alternative Fortran compiler that solves the problem in a more direct way then I would be interested to see what the syntax looks like.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Fri Sep 03, 2010 4:22 pm    Post subject: Reply with quote

Most of what I have written on this subject can now be ignored because I have been advised that there is a SLINK command for this purpose.

Create the DLL with the usual SLINK commands.

When creating the executable, use rlo instead of lo (or load) in order to load the dll. You can do this from a SLINK script. I have not tried it from the command line.

The result is that the dll does not need to be present when the executable is loaded at runtime.

In your code you will need to test if the dll is present before allowing a call to the dll. Otherwise if it is not present then an exception will be raised because of the missing routine.
Back to top
View user's profile Send private message AIM Address
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Sat Sep 04, 2010 9:10 am    Post subject: Reply with quote

Hi Paul,

it is working fine! We will add a check if the DLL is present.

Thanks

Detlef
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Sun Sep 05, 2010 8:37 am    Post subject: Reply with quote

I should add that a call to LoadLibrary is probably the best way to test if a DLL is accessible.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
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