Hello,
I was wondering how do I create a SAFEARRAY that holds a non trivial type like a strcut I define?
Thanks
Avi
Printable View
Hello,
I was wondering how do I create a SAFEARRAY that holds a non trivial type like a strcut I define?
Thanks
Avi
Wrap std::vector as member in a new class, and implement 2 versions
for operator[] (for const and non-const accesses) with safety bounds checks.
provide any interface you need such as insert,reserve and so.
Regards,
Guy
Based on his previous posts, I believe that the mentioned SAFEARRAY is from MS COM.
yep, anyway I find out how to do that (in some other post):Quote:
Originally Posted by Kheun
SAFEARRAY * psa;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 0;
psa = SafeArrayCreate(VT_RECORD, 1, rgsabound);
what I still don't know how to do is the connection points/callback/events (my other thread)
Any chance you know?
Thanks
Avi
I did that about 2 years ago and unfortunately I couldn't recall the details now. Anyway, I managed to do that based on Chapter 8 in the book, The COM and COM+ Programming Primer by Alan Gordon.