#include <wx/msw/ole/automtn.h>
This class represents a thin wrapper for Microsoft Windows SCODE type (which is the same as HRESULT).
It is used for converting between a wxVariant and OLE VARIANT with type set to VT_ERROR. When wxVariant stores wxVariantDataErrorCode, it returns "errorcode" as its type. This class can be used for returning error codes of automation calls or exchanging values with other applications: e.g. Microsoft Excel returns VARIANTs with VT_ERROR type for cell values with errors (one of XlCVError constants, displayed as e.g. "#DIV/0!" or "#REF!" there) etc. See wxVariantDataCurrency for an example of how to exchange values between wxVariant and a native type not directly supported by it.
Include file:
#include <wx/msw/ole/oleutils.h>
Public Member Functions | |
wxVariantDataErrorCode (SCODE value=S_OK) | |
Constructor initializes the object to value or S_OK if no value was passed. More... | |
SCODE | GetValue () const |
Returns the stored SCODE value. More... | |
void | SetValue (SCODE value) |
Set the stored value to value. More... | |
virtual bool | Eq (wxVariantData &data) const |
Returns true if data is of wxVariantDataErrorCode type and contains the same SCODE value. More... | |
virtual bool | Write (wxString &str) const |
Fills the provided string with the textual representation of this object. More... | |
wxVariantData * | Clone () const |
Returns a copy of itself. More... | |
virtual wxString | GetType () const |
Returns "errorcode". More... | |
virtual bool | GetAsAny (wxAny *any) const |
Converts the value of this object to wxAny. More... | |
Public Member Functions inherited from wxVariantData | |
wxVariantData () | |
Default constructor. More... | |
void | DecRef () |
Decreases reference count. More... | |
virtual bool | GetAny (wxAny *any) const |
Converts value to wxAny, if possible. More... | |
virtual wxClassInfo * | GetValueClassInfo () |
If the data is a wxObject returns a pointer to the objects wxClassInfo structure, if the data isn't a wxObject the method returns NULL. More... | |
void | IncRef () |
Increases reference count. More... | |
virtual bool | Read (istream &stream) |
Reads the data from stream. More... | |
virtual bool | Read (wxString &string) |
Reads the data from string. More... | |
virtual bool | Write (ostream &stream) const |
Writes the data to stream. More... | |
wxVariantDataErrorCode::wxVariantDataErrorCode | ( | SCODE | value = S_OK | ) |
Constructor initializes the object to value or S_OK if no value was passed.
|
virtual |
Returns a copy of itself.
Reimplemented from wxVariantData.
|
virtual |
Returns true if data is of wxVariantDataErrorCode type and contains the same SCODE value.
Implements wxVariantData.
|
virtual |
Converts the value of this object to wxAny.
|
inlinevirtual |
Returns "errorcode".
Implements wxVariantData.
SCODE wxVariantDataErrorCode::GetValue | ( | ) | const |
Returns the stored SCODE value.
void wxVariantDataErrorCode::SetValue | ( | SCODE | value | ) |
Set the stored value to value.
|
virtual |
Fills the provided string with the textual representation of this object.
The error code is just a number, so it's output as such.
Reimplemented from wxVariantData.