Solved

passing by reference in vb6

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
squareUp  challenge 22 105
Reading variable length EBCDIC in SAS 9 75
countX 22 70
wordappend challenge 8 85
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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 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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

708 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

17 Experts available now in Live!

Get 1:1 Help Now