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

x
?
Solved

passing by reference in vb6

Posted on 2004-08-04
5
Medium Priority
?
798 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 1000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

972 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