Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

passing by reference in vb6

Posted on 2004-08-04
5
Medium Priority
?
797 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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 …
Progress

730 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