|
-
Apr 18th, 2009, 05:31 PM
#1
Re: Setting an array with an arbitary number of dimensions to base 0
 Originally Posted by Ellis Dee
or hacking the SafeArray definition directly
This is the way to go. It's a straightforward process and pretty simple.
Arrays in VB6 are stored in SAFEARRAY structures. As you can see from that article, the structure pertinent to this questions is the tagSAFEARRAYBOUND structure. All that is required to do what you want is to identify all the tagSAFEARRAYBOUND entries for an array and change all the LBounds to 0. That's it. No data need be copied anywhere, so it'll be instantaneous even if your array has gigs of data.
Sadly, I don't actually know how to modify the SAFEARRAY headers directly. Others do, though, so I'll see if I can get them to post some code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|