Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaration of DLL Connections 1

Status
Not open for further replies.

JaBurd311

MIS
Sep 21, 2001
24
0
0
US
We have a vb interface that calls functions from a Fortran DLL. Below is our code. Our problem is, VB will only allow us to hard code a string into our declare statement. We would like to be able to use a variable or so we can let the user install the dll wherever they choose. Is it possible to do this? Do we need to make our declare statement different? It is currently located in the general declarations.

Thanks in advance for any assistance you can provide.

'Connection to Fortran DLL containing conversion code:
Private Declare Sub ZCOORDS Lib "c:\temp\BMX5CONVERT.DLL" (IRLAT As Double, ByVal RLATDIR As String, _
ByVal STR_RLATDIR_LEN As Long, IRLON As Double, ByVal RLONDIR As String, _
ByVal STR_RLONDIR_LEN As Long, IMODE As Long, _
ILAT As Double, ByVal LatDir As String, ByVal STR_LATDIR_LEN As Long, _
ILON As Double, ByVal LonDir As String, ByVal STR_LONDIR_LEN As Long, _
XNFT As Single, YEFT As Single)
 
From Visual basic Concepts
Declaring a DLL Procedure
If you do not specify a path for libname, Visual Basic will search for the file in the following order:

1. Directory containing the .exe file
2. Current directory
3. Windows system directory (often but not necessarily \Windows\System)
4. Windows directory (not necessarily \Windows)
5. Path environment variable

There may be a difference in # 1 between running in the IDE and runnung from the compiled .exe. Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Superb! Thank you so much for your help. Much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top