- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everybody,
Can any one help about how to share strcutures and data between an IVF DLL and a C# program. I have series of subroutines made with IVF. these subroutines are called from an interface created with C# 2005.
the question is how to make the changes made on data and structures in the call of one subroutine, seen in the other calls.
in other words, when i call for example a subroutine that multiplies x by 2, i want that any other subroutine using x will be called with the new value of x.
x is only an example but i would like to know is how to exchange whole stuctures between the subroutines in the DLL and the C# program.
thank you.
Can any one help about how to share strcutures and data between an IVF DLL and a C# program. I have series of subroutines made with IVF. these subroutines are called from an interface created with C# 2005.
the question is how to make the changes made on data and structures in the call of one subroutine, seen in the other calls.
in other words, when i call for example a subroutine that multiplies x by 2, i want that any other subroutine using x will be called with the new value of x.
x is only an example but i would like to know is how to exchange whole stuctures between the subroutines in the DLL and the C# program.
thank you.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One way is, that you declare x in a module you use in every subroutine:
module GlobVars
real*4 x
end module
subroutine multiply(factor1, factor2)
use GlobVars
real*4 factor1, factor2
x = factor1*factor2
end subroutine
When you need to know the value of x in C# you simply create a function that returns the value of x:
Fortran code:
real*4 function GET_X()
!DEC$ ATTRIBUTES DLLEXPORT::GET_X
use GlobVars
GET_X = x
end function GET_X
C# code:
[DllImport("fortran.dll")]
private extern static float GET_X();
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you markus,
i appreciated your help.
i ll try this and i ll keep you informed.
i appreciated your help.
i ll try this and i ll keep you informed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Arrays and strings are a little bit tricky compared to integer or real types.
When you need any help, drop a mail.
Markus

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page