- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I understand that this topic has alreadybeen dealt with and I found the newsletter by Steve Lionel very useful (thank you) but I now would like adapt the code and pass a 2-dimensional array.As Steve Lionel shows, passing a vector works well and I was able to replicate thatbut with a 2-dimensional arraythis call:
iRes = SafeArrayGetElement(VBArray,i, LOC(StringPtr))
becomes problematic for me. I had hopedI couldchanged it to something where the "i" becomes an array such as for example(/2,2/). So I declared rgIndices(2)andusedthis:
iRes = SafeArrayGetElement(VBArray,rgIndices, LOC(StringPtr))
Unfortunately I got this error message "The shape matching rules of actual arguments and dummy arguments have been violated". So I tried to use:
iRes = SafeArrayGetElement(VBArray,rgIndices(1), LOC(StringPtr))
and that compiles but does not seem to work. Note that I tried to send 0-based positions and tried to have the second dimension in rgIndices(1) and the first dimension in rgIndices(2) etc... but it seems that I am just unable to pass the right location in the expected format so neverretrieve any pieces of text in VBarray.
I appreciate your help, thank you,
Pierre
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see, thank you for your help. Now I also got the "old" way to workand I was wondering about the differences between the two pieces of code. Is the new way, using ifcom and then replacing SysStringByteLen()byConvertBSTRToString() and getting rid of the interface more efficient?
Thank you,
Pierre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page