Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to build a SAFEARRAY?

Status
Not open for further replies.

d00ape

Programmer
Apr 2, 2003
171
SE
I’m about to make a SAFEARRAY and pas it into a this function:

void IAcadSelectionSet::AddItems(const VARIANT& pSelSet)
{
static BYTE parms[] =
VTS_VARIANT;
InvokeHelper(0x7, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
&pSelSet);
}

At first I don’t really know why I know the pSelSet is a SAFEARRAY.

I know I have to do something like:

VARIANT var;
VariantInit( &var );
var.vt = VT_ARRAY;

But when I do then do this call:

myIAcadSelectionSet.AddItems( var );

it craches!!

Of course the array is empty but would the call crash cause of that?
I’m soon clear with the meaning of COM-calls but now I’m stucked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top