Solved

passing by reference in vb6

Posted on 2004-08-04
5
792 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 69

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.
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…
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…

863 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

23 Experts available now in Live!

Get 1:1 Help Now