d00_ape Posted August 20, 2004 Share Posted August 20, 2004 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. Link to comment Share on other sites More sharing options...
0 figgy Posted August 20, 2004 Share Posted August 20, 2004 (edited) SAFEARRAY* sfarray; sfarray = SafeArrayCreate( ... blah blah variant_t var; var.vt = VT_ARRAY | VT_VARIANT; var.parray = sfarray; AddItems((const VARIANT&) var) Edited August 20, 2004 by figgy Link to comment Share on other sites More sharing options...
Question
d00_ape
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:
But when I do then do this call:
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.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts