Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Call FORTRAN DLL (passing String)

Posted on 1998-03-23
1
Medium Priority
?
477 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 400 total points
ID: 1459659
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

916 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