Archived

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

c++ array to vb-array via dll

This topic is 5847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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