COMReturnError()
You know those obnoxious error messages you get that say "OLE IDispatch exception code blah, blah, blah?" Well, now you don't just have to be the poor hapless recipient of them—you can create your own and share the fun with others!
Usage |
COMReturnError( cServerName, cErrorDescription ) |
Parameter |
Value |
Meaning |
cServerName |
Character |
This string is returned in the error message and should describe your software. |
cErrorDescription |
Character |
This string is returned in the error message after cServerName. |
AError() returns seven values for an OLE Error 1429, but this command lets us set only two of them. It sure would be nice in a future version if Microsoft would consider letting us set the error code to something other than the suspicious-looking zero (in VFP 6) or plain vanilla 1000 (in VFP 7). Even better, it would be nice to be able to set all of the values. |
Error 1429 is documented as returning the sixth element of AError() as either character or null. In our tests, it always came back as a numeric 0. If you're writing a generic error handler, look out for these type inconsistencies! |
Example |
COMReturnError("MyServer","MyErrorGenerator") |
See Also |
AError(), CreateObject(), CreateObjectEx(), Error Event, On Error |