COMVariant.sCode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
sCode() |
Gets or sets the value of a COMVariant object of the VT_ERROR data type. |
sCode(Int32) |
sCode()
Gets or sets the value of a COMVariant object of the VT_ERROR data type.
public:
virtual int sCode();
public virtual int sCode ();
abstract member sCode : unit -> int
override this.sCode : unit -> int
Public Overridable Function sCode () As Integer
Returns
The current value.
Remarks
If you pass in a value that has a different data type than the object, the data type of the object will be changed to match the data type of the value. A COMVariant object has an scode data type if its data type is set to COMVariantType::VT_ERROR. The scode data type is a COM data type that is equivalent to the Win32 HRESULT data type, which is most used as return values for COM functions.
The following example creates a new COMVariant object of type VT_ERROR and sets the value to 0x80001004.
{
COMVariant var = new COMVariant(
COMVariantInOut::IN_OUT,
COMVariantType::VT_ERROR);
// Set value of the object
var.sCode(0x80001004);
}