Solved

passing by reference in vb6

Posted on 2004-08-04
5
794 Views
Last Modified: 2011-10-03
Hi all,
  Can anyone tell me how to pass an integer array by reference in vb6? I have a dll written in fortran, and I need to pass an integer array to it by reference. I would really appreciate an example. Thank you.

paul
0
Comment
Question by:struggling_coder_3203
  • 3
5 Comments
 
LVL 22

Expert Comment

by:cookre
ID: 11717324
ByRef
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11717357
declare your function as:

YourFunc(ByRef  anArray() as integer)
0
 
LVL 22

Accepted Solution

by:
cookre earned 500 total points
ID: 11717388
Private Declare Function apiRegQueryInfoKey Lib "advapi32.dll" _
        Alias "RegQueryInfoKeyA" (ByVal hKey As Long, _
        ByVal lpClass As String, ByRef lpcbClass As Long, _
        ByVal lpReserved As Long, ByRef lpcSubKeys As Long, _
        ByRef lpcbMaxSubKeyLen As Long, _
        ByRef lpcbMaxClassLen As Long, _
        ByRef lpcValues As Long, _
        ByRef lpcbMaxValueNameLen As Long, _
        ByRef lpcbMaxValueLen As Long, _
        ByRef lpcbSecurityDescriptor As Long, _
        ByRef lpftLastWriteTime As FILETIME) As Long
0
 
LVL 22

Expert Comment

by:cookre
ID: 11717403
One of these days I'll remember to refresh to avoid cross posts...
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 11717895
>> I have a dll written in fortran, and I need to pass an integer array to it by reference

If the dll is built to receive the array byval, you cannot change it.

Otherwise, you simply pass your array variable.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

821 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