Silverfrost Forums

Welcome to our forums

Using dll reference in main application

28 Mar 2016 4:26 #17353

Hello

I am creating a common function in DLL which includes few published functions.

I have created a Main Program, which needs to refer to that DLL to use the published function.

May I know how will I do this, in our Silverfrost FTN95 Express. I tried with very simple function viz sending two variables and returns the sum of those two variables.

Here is the code that I used.

Main program

program main 
 include 'ModuleDll' 
  
 real :: a, b, c, d 
  a= 5.0 
 b= 2. 
  d = calresult(a,b,c)
  print*, 'Printing the received result:'
  print*, c 
end program main 

Reference function in DLL project .

module ModuleDll 


contains 
real function calresult ( a, b, c) 
   real, intent(in) :: a, b 
   real, intent(out) :: c 
    
   print*, 'The received inputs are :' 
   print*, a, b, c 
   c = a*b 

end function calresult 
end module ModuleDll

I have made this ModuleDll (I created this as a DLL file and referred this in Main application project Reference in Project Explorer)

But the problem here is that this calresult() is not published in the main program.

I am trying to create a common library function, which can be used by any other main application, by making the reference to those libraries.

Some what I am not clear with the configurations that I have to use it in FTN95 Express. Pls. help how to establish the skeleton structure here in the program.

Thank you..

Please login to reply.