I've looked both at MSDN online and in the help that comes with VC6, and
they both say the same. The description of it says:
"Creates a one-dimensional array whose lower bound is always zero"
But the second parameter is described as:
"lLbound
The lower bound for the array. Can be negative."
Is it me or does that not make sense? How can it be "always zero" and then
asks you to specify the lower bound and it can be negative?!!
---
Now, in the second part of this exciting episode, I'm having trouble using
it (big surprise!). I've got an ActiveX control that I'm trying to get to
fire an event back to the container. One of the parameters being sent back
in this event is a variant - eventually I want the variant to contain an
array of BYTE (VT_UI1). I have a tiny VB client compiled to an EXE to test
it - it doesn't try to use the parameter at this stage, it simply flags that
the event was captured.
Now, if I fill the VARIANT like this:
varBuffer.iVal = 1 ;
varBuffer.vt = VT_I2 ;
and fire the event, no problemo - the VB client runs just fine,
acknowledging that the event was captured successfully.
But if I try like this:
SAFEARRAY *pSA = ::SafeArrayCreateVector(VT_UI1, 0, dwNumBytes);
varBuffer.parray = pSA ;
varBuffer.vt = VT_ARRAY|VT_UI1 ;
the client crashes with an access violation {:v(
Any ideas of what I've done wrong?
--
Jason Teagle
[EMAIL PROTECTED]