> Personally, I have always used SafeArrayCreate( ).  And I suggest
> if you're
> using VC7 or above, take a look at CComSafeArray.  It's extremely handy.

VC6 here, so can't try that {:v)

> A small suggestion:
>
>  V_I2(&varBuffer) = 1;
>  V_VT(&varBuffer) = VT_I2;

Yes, I discovered those macros a couple of hours ago while trawling the net
to try and find an answer; all I found were many snippets of code doing
exactly the same as me {:v(

> Erm, have you tried filling the array?  Also, have you tried using
> SafeArrayCreate( ) instead?

Yep, tried using SafeArrayAccessData(), memcpy(), then
SafeArrayUnaccessData(). That was what I had originally, before I tried
breaking it down to find out what was wrong.

Haven't tried SafeArrayCreate(), but what I have done is examine the
SAFEARRAY returned to see if the members look fine - and they do, even to
having FADF_HASVARTYPE in the fFeatures member (a flag that I learned of
later from finding SafeArrayCreateVectorEx() online). I honestly can't see
anything wrong - and since it's an array of primitives, I don't believe not
filling it is the problem - there should already be bytes in the array even
if they're meaningless (and as I said above, I did try that anyway to start
with).

Since I have nothing better to do, I could try SafeArrayCreate() on the
off-chance {;v)

--
Jason Teagle
[EMAIL PROTECTED]




Reply via email to