Returning an array from C dll to VB

M

mr_nice

I have a C DLL which accesses a database (actually it accesses another dll
which accesses the database, don't ask its an historical thing ). From VB
I pass the experiment number and the signal type I require (i.e experiment
10 and magnetic field data) and the C DLL uses a function called 'getdat'
and hey presto I have two arrays of floats which are time and data (UBound
is diiferent for different data types but UBound(time) = UBound(data) ). I
need these two arrays passed back to my VB program.

Do I need to create a safearray and pass the result back somehow?? I have
no real understanding of these safearrays and I am completely lost in how
to pass these arrays back and therefore, any help would be brilliant. I
appreciate there maybe better methods to send and return data than dll's
but I am dealing with old historical methods of data retreival and this is
the only option I have.

If I could get any any examples of passing back two arrays or maybe
combining the two in a two dimensional array (as they are the same size) I
would be extremely grateful as I have reached the limits of my programming
ability and am at the communities mercy.

Nice
 
C

Christopher Benson-Manica

mr_nice said:
I have a C DLL which accesses a database (actually it accesses another dll
which accesses the database, don't ask its an historical thing ). From VB
[trimmed]

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.

<rant>www.talkaboutprogramming.com would be well advised to stop
representing the Usenet groups it offers access to as "programming
chats"; Usenet is not a "chat", and those groups have well-defined
topics and rules of etiquette that those who post to them should be
aware of. The site owners are not doing their members any favors by
failing to mention them.</rant>
 
C

CBFalconer

mr_nice said:
I have a C DLL which accesses a database (actually it accesses
another dll which accesses the database, don't ask its an
historical thing ). From VB I pass the experiment number and the
signal type I require (i.e experiment 10 and magnetic field data)
and the C DLL uses a function called 'getdat' and hey presto I
have two arrays of floats which are time and data (UBound is
diiferent for different data types but UBound(time) = UBound(data)).
I need these two arrays passed back to my VB program.

VB, databases, dlls, etc. have nothing to do with the portable C
language, but probably much to do with the Microslush software that
generates and manipulates them. You should ask in a newsgroup that
deals with those system specific things. It probably has Microsoft
in its name somewhere. c.l.c deals only with portable C code that
functions on any system that adheres to the ISO C standards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top