The method used to handle errors depends on the development language/tool used. Some provide special mechanisms to retrieve error message codes and message text. In .NET, a failing property or method raises a System.Runtime.InteropServices.COMException whose Message is the error text shown below. Please see your development tool's documentation for specific information on error handling.
C and C++ users can use the #include file \Program Files (x86)\Softelvdm\SftDate OCX 2.0\Include\SftDateOCXErrors.h. It offers predefined preprocessor symbols for the errors generated by SftDate/OCX (i.e., the errors shown below named SFTDATE_E_xxx and SFTDATAOBJECT_E_xxx). The standard errors (CTL_E_xxx) are defined in the Windows SDK header file olectl.h.
| Error | Description |
|---|---|
| 7 (CTL_E_OUTOFMEMORY) | An object could not be allocated, for example "Can't allocate SftDateSpecialDate object.". |
| 380 (CTL_E_INVALIDPROPERTYVALUE) | A property was set to an invalid value, or a method argument is invalid. The text names the property, for example "The Recurrence value is invalid.", or describes the reason: "The date is outside the range defined by MinDate and MaxDate, or the control does not allow an empty value." - Value, RangeStart or RangeEnd was set to a date outside the limits (MinDate, MaxDate), or to Null for a date field control that allows neither an empty value (AllowEmpty) nor a cleared check box (ShowCheckBox). "The range is outside the range defined by MinDate and MaxDate, or longer than Calendar.MaxRangeDays." - SetRange was called with an invalid range (see MaxRangeDays). "The date is outside the range defined by MinDate and MaxDate." - FocusedDate of a month calendar control. "The view is not one of Calendar.AllowedViews." - View of a month calendar control (see AllowedViews). "The text is not a valid date or time for this field." - Text of a date field control. "The locale is unknown, or does not offer the calendar defined by CalendarType." - Culture. "The locale defined by Culture does not offer this calendar." - CalendarType (see GetOptionalCalendars). "The date is outside the supported range." - the date of a special date (Add, Insert, Date) is not within the years 100 to 9999. |
| 387 (CTL_E_SETNOTPERMITTED) | The property cannot be set at this time, for example the _FlatProperties property at run time. |
| 394 (CTL_E_GETNOTSUPPORTED) | The property cannot be retrieved at this time, for example the _FlatProperties and License properties at run time. |
| 481 (CTL_E_INVALIDPICTURE) | The picture object is invalid, or is not of a type the property accepts. The MouseIcon property only accepts icons. |
| 1004 (SFTDATE_E_INVALIDINDEX) | "The special date index is invalid." - The Index argument of a SftDateSpecialDates method or property (Item, Insert, Remove) is out of bounds. The index is zero-based, which means the valid range of index values is 0 to Count - 1 (0 to Count for Insert). |
| 1005 (SFTDATE_E_NOTNOW) | "A range can only be set when SelectionMode is selectionSftDateRange." - SetRange was called for a control that selects single dates (SelectionMode). |
| 1100 (SFTDATE_E_OBJECTINVALID) | "The SftDateCalendar object refers to a destroyed control." or "The SftDateSpecialDates object refers to a destroyed control." - A SftDateCalendar or SftDateSpecialDates object is used (or an interface pointer references an object) after the control it belongs to has been destroyed. This can occur if a reference to the object is saved, for example in a variable of a form, and used after the form and its controls have been closed. |
| 2000 (SFTDATAOBJECT_E_INVALIDUSE) | A DataObject is used in an inconsistent manner. A drop target cannot update the DataObject and a drag source cannot retrieve data from the DataObject. |
| 2001 (SFTDATAOBJECT_E_UNSUPPORTEDFORMAT) | The data format or storage medium to be added to the DataObject or about to be retrieved is not supported by the product. |
| 2002 (SFTDATAOBJECT_E_ARGREQ) | A required argument is missing. Please see the documentation of the failing property or method. |
| 2003 (SFTDATAOBJECT_E_TYPEBAD) | The data argument has a type which is inconsistent with the specified data format. |
| 2004 (SFTDATAOBJECT_E_NOSUCHFORMAT) | The Format requested using the DataObject.GetData method is not available. It has not been added to the DataObject by the drag source. |
| 2005 (SFTDATAOBJECT_E_NODATA) | No data has been provided to the DataObject by the drag source, even though the drag source indicated that the specified Format will be available. |
| 2006 (SFTDATAOBJECT_E_OBJECTINVALID) | A DataObject object is used (or an interface pointer references an object) which is no longer valid. This can occur if a reference to an object is saved, but the object has been removed. |
| 2010 (SFTDATAOBJECTFILES_E_INDEXINVALID) | An invalid item index was specified (usually the ItemIndex argument). The item index is one-based, which means the valid range of index values is 1..DataObjectFiles.Count. Please see the documentation of the failing property or method. |
| 2011 (SFTDATAOBJECTFILES_E_OBJECTINVALID) | A DataObjectFiles object is used (or an interface pointer references an object) which is no longer valid. This can occur if a reference to an object is saved, but the object has been removed. |
| 2200 (SFTPICTURE_E_OBJECTINVALID) | A SftPictureObject object is used (or an interface pointer references an object) which is no longer valid. This can occur if a reference to an object is saved, but the object it belongs to has been removed. |
Using the property pages at run time fails with the error "Property pages are not supported at runtime." (E_UNEXPECTED); the property pages are only available at design time.