Compartir a través de


Passing Empty Variants

Passing Empty Variants

Many Microsoft .NET Passport methods take optional VARIANT structures as input arguments. In C++ syntax, these parameters cannot be truly empty because of the DISPPARAMS structure conversion done as part of handling by IDispatch::Invoke. The recommended way to supply default values for optional VARIANT input parameters is to supply a VARIANT with .vt member value of VT_ERROR and .scode member value of DISP_E_PARAMNOTFOUND.

For more information, search for the terms "DISPPARAM", "optional", and "variant" on MSDN®.