Solved

Call FORTRAN DLL (passing String)

Posted on 1998-03-23
1
470 Views
Last Modified: 2013-11-08
I can't seem to get a VB app to call a FORTRAN DLL with a String parameter? I've been using the following code in VB:

Declare Sub GETSTRING Lib "d:\VB4\fortint.dll" Alias "_GETSTRING@8" (Myarray As String)

VB actually crashes when this is run, so I have no idea what the problem is. I've also tried the code listed in the FORTRAN Developer Studio (as above, without Alias), but VB says "Can't find insertion point...". I really need some working code on this one, so I hope that someone can help.
0
Comment
Question by:mffej
1 Comment
 
LVL 5

Accepted Solution

by:
dirtdart earned 200 total points
Comment Utility
When passing strings from VB to another language, you need to use ByVal, so your declaration would look like this:

Declare Sub GETSTRING Lib "d:\vb4\fortint.dll" Alias "_GETSTRING@8" (ByVal MyArray As String)

You should probably also tell VB what type of return to expect by appending As Long, As String, or whatever is appropriate to the end of the declaration.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 65
count11 challenge 6 47
wordcount challenge 11 73
Non-recursive backtracking, using a stack 1 47
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now