AnsweredAssumed Answered

vrf FORTRAN DLL

Question asked by martin.papproth on Feb 16, 2006
Latest reply on Feb 16, 2006 by martin.papproth
Hi JC,
 
the refprop.dll is not a type library; it's a plain C-style windows DLL; ie. when the fct. is called the parameters are put onto the stack in C-style manner. So it does not really matter in with which programming language the DLL has been created; only the interfacing is important.
In order for VEE to be able to use this DLL, you need a dll definition file (similar a C header file). You can construct this file yourself, because these definitions can be found in the Excel sheet's macro Module1. There you find entries like this
 
Public Declare Sub SETUPdll Lib "Refprop" (i As Long, ByVal hfld As String, ByVal hfmix As String, ByVal hrf As String, ierr As Long, ByVal herr As String, ln1 As Long, ln2 As Long, ln3 As Long, ln4 As Long)
Public Declare Sub SETREFdll Lib "Refprop" (ByVal hrf As String, ixflag As Long, x0 As Double, h0 As Double, s0 As Double, t0 As Double, p0 As Double, ierr As Long, ByVal herr As String, ln1 As Long, ln2 As Long)
Public Declare Sub SETMODdll Lib "Refprop" (i As Long, ByVal htype As String, ByVal hmix As String, ByVal hcomp As String, ierr As Long, ByVal herr As String, ln1 As Long, ln2 As Long, ln3 As Long, ln4 As Long)

For VEE the definition file looks like this:
void SETUPdll (long i, char* hfld, char* hfmix, char* hrf, long ierr, char* herr, long ln1, long ln2, long ln3, long ln4);
void SETREFdll (char* hrf, long ixflag, double x0, double h0, double s0, double t0, double p0, long ierr, char* herr, long ln1, long ln2);
:
:
 
You see the logic behind ? You can read more about it in the "VEE_Pro_Advanced_Techniques.pdf" which ships with your installation CD of Agilent VEE. See chapter 12 "User-Defined Functions/Libraries"
 
In VEE itself you import the dll as compiled library. In the import box you specify the DLL and the definition file (created above). Afterwards you can drag&drop the function calls from the function&object browser or program explorer.
 
Furthermore I'm quite sure you'll find lots of information on importing DLLs in the VRF archive:  http://www.oswegosw.com/vrf_archive
 
br
Martin


  _____  

From: ext VEE Pro(JC Park) [mailto:jcpark@kornets.co.kr]
Sent: Donnerstag, 16. Februar 2006 08:03
To: VRF
Subject: [vrf] FORTRAN DLL


Hello VRF,
 
I have a customer who needs to call a DLL from VEE.
The source of the DLL(refprop.DLL) is written with FORTRAN and was able to called from Excel VBA.(Refprop.xls)
 
I wanted to use it in the VEE and tried “Device => ActiveXAutomation References…†.
However an error message was shown up like : “refProf.DLL is not a valid type library file†.
And same error was generated in VB 6.0 too.
 
It seems it is possible to use the DLL as it was done in the VBA.
 
How can I use it from VEE?
 
 
Regards,
JC Park

---
You are currently subscribed to vrf as: martin.papproth@nokia.com
To subscribe send a blank email request to "join-vrf@lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".
---

To subscribe send a blank email request to "join-vrf@lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".  

Outcomes