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 

The questions about C++ to use ftn95 dll

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
zenic



Joined: 26 Jul 2007
Posts: 5

PostPosted: Fri Jul 27, 2007 4:16 am    Post subject: The questions about C++ to use ftn95 dll Reply with quote

I want to use C++ to implement the user interface, and

implement the calculation part with Fortran.

I know I should make Fortran code to be DLL conceptually,but I

don't know what to do in practice.

What directives should I put in the Fortran code?

how to export my subroutine?

and how to call them from C++.NET?

I have installed this Fortran compiler, and it is already integrated in Visaul

Studio .NET 2003.

And can anyone tell me whether it is right?


subroutine demo(m,n,a)
!DLLEXPORT
!ASSEMBLY_INTERFACE (name = "demo");


integer*4 n;
integer*4 m;
integer*4 a;

a = m + n;

return
end subroutine

Thank you very much. ^^
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Jul 27, 2007 8:19 am    Post subject: Reply with quote

There is a section on this in FTN95.chm under Win32 Platform->Mixed language programming->Calling FTN95 from C/C++.

Your sample code contains comments that look a little like comment embedded directives. You can use comment embedded directives but they must begin with !FTN95$.

ASSEMBLY_INTERFACE is only for .NET.
Back to top
View user's profile Send private message AIM Address
zenic



Joined: 26 Jul 2007
Posts: 5

PostPosted: Fri Jul 27, 2007 10:17 am    Post subject: Thank you very much Reply with quote

Thanks!

I have found that article, and it helps me a lot.

But may I ask you what is the difference between Win32 and .NET platform,

may I create dll on the .NET platform?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Jul 27, 2007 1:28 pm    Post subject: Reply with quote

Try typing "What is .NET framework" into Google.

You can create a .NET dll but then you would probably use C# as a first choice or possibly "managed" C++.
Back to top
View user's profile Send private message AIM Address
zenic



Joined: 26 Jul 2007
Posts: 5

PostPosted: Mon Jul 30, 2007 8:03 am    Post subject: Reply with quote

Thank you very much!

I will try it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General 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