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!

Setting a value to "null" (in a SafeArray)

Status
Not open for further replies.

MattWoberts

Programmer
Oct 12, 2001
156
GB
Hi,

Its been years since I needed to work in VC++, and I have an embarrasingly simple question, that I can't work out!!

I have an array, and I need to set its value to "null".

My code that adds the value to the array is something like this:

_variant_t v2;
v2 = 10;
SafeArrayPutElement(psa,lDimension,&v2);

How can I set it to "null". Obviously, I can't just do this:

v2 = null;
SafeArrayPutElement(psa,lDimension,&v2);

Any ideas?
 
Agh, found the answer myself:

MSDN artcile Q229088 has all the juicy info.
 
The SafeArray does not allow VT_NULL vartype.
-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top