Click to See Complete Forum and Search --> : dll entry point


Riakdit
October 19th, 1998, 01:51 PM
Hi,


I am trying to access a DLL writen in Fortran. Unfortunately, whenever the VB module attempts to communicate with the DLL I get run-timr error 453 and this message 'cannot find the DLL entry point'


The code for the VB and Fortran modules are listed below. I will appreciate your help.


Riak


Option Explicit

Private Type StringArray

strings As String * 24

End Type

Private Declare Sub FORSTRARR Lib "E:VB\fortVB.dll" (Myarray As

StringArray)


Private Sub Command1_Click()

Dim I As Integer

Static arr(1 To 5) As StringArray

Call FORSTRARR(arr(1))

For I% = 1 To 5

text1.Text = arr(I%).strings + Chr$(13) + Chr$(10) + text1.Text

Next I%

End Sub


The fortran DLL contains the following code


SUBROUTINE forstrarr(arr)

CHARACTER(24) arr(5)

arr = "This is a string from Fortran."

END SUBROUTINE

ben curthoys
October 20th, 1998, 12:03 PM
the one thing i know that may be relevant is that to call a function in a dll from vb the function must use the pascal calling convention. i don't know fortran, but if it doesn't use pcc then it won't work.

Justin Decker
October 28th, 1998, 07:15 PM
When you make a dll in any other language buy VB, you have to do something in the code to make it export the function someohow... in C/C++ you would add a few lines to the header file and prefix EXPORT infront of your function name. I dont know fortran so I couldn't tell you how to do it in that language.

sbalaji75
December 27th, 1999, 11:56 PM
Hi,
I too face the same probs when i try to access a VB DLL from an VB EXE Being a VC++ programmer i can understand that the function in a DLL has to be exported and i being a VB learner i don't know how to export a function from a VB DLL so that i can access that from VB EXE File.
Any help will be of Very much Use to Me.
Being a Newbie to this site i would like to sent a copy to sbalaji75@hotmail.com.
Thanks.