Software Archive
Read-only legacy content
17061 Discussions

error in VB, can not find dll... can any one help?

fastian
Beginner
471 Views
Hi,
I have a huge fortran project as a dll from which I have exported a single function. Now when I call the exported function from VB, it gives an error message, "error 53, dll not found" All the paths are correct BTW.
The exported function works fine if I call it from VC but vb gives this error. I made another VC DLL so that I can call this fortran dll from there and call VC dll from VB. It started off fine. I put a message box in the call and it popped. But when I dllimport the fortran function in the VC DLL, VB started giving the same error for my VC DLL i.e. dll not found.
Can any one help me with this. What seems to be the problem here.

Regards,

Mohsin
0 Kudos
1 Reply
sabalan
New Contributor I
471 Views
I suppose that you have a module in your VB-project where you declare your Fortran function, say something like this:

Declare Function MyForFunc Lib ?MyForDLL.dll? (Var1 As Double, ByVal String1 As String,?)

Now, you have to either have MyForDLL.dll in your path (run SET at command prompt to see your path) or write the whole path to MyForDLL.dll in the declaration, say:

Declare Function MyForFunc Lib ?C:MyProgramsNewProjMyForDLL.dll? (Var1 As Double, ByVal String1 As String,?)

Otherwise you are going to get error 53.

Hope this helps.

Regards,

Sabalan.
0 Kudos
Reply