Archived

This topic is now archived and is closed to further replies.

edotorpedo

c++ array to vb-array via dll

Recommended Posts

How can you copy an entire array from a c++ dll to a VB6 array ? The data type is long. What I do is pass a pointer from the c++ array in the dll to the VB-application, and then use CopyMemory arrayVB(0), pointerFromDLL, numberOfBytes to copy the array. This doesn''t work. Is it possible at all, or do I have to copy all elements one at the time? Thanks, Edotorpedo

Share this post


Link to post
Share on other sites
SAFEARRAY
<gives edotorpedo a large bottle of asprin>

Magmai Kai Holmlor

"Oh, like you''ve never written buggy code" - Lee

"What I see is a system that _could do anything - but currently does nothing !" - Anonymous CEO

Share this post


Link to post
Share on other sites
VB doesn''t use arrays the way C++ does. All arrays in VB are actually SAFEARRAYs so that VB can provide bounds checking etc...

Look around for a SAFEARRAY tutorial / article somewhere. Oh, and as Magmai said, don''t forget the asprin.

Share this post


Link to post
Share on other sites