(Updated: 1999.12.01 08:57:48 AM)
| |
Some things about COM errors:
- Like all Trappable Errors, trappable COM errors can be handled in On Error or in an Error Event.
- The Hackers Guide states that nError values of 1426 to 1429 are probably Com Errors even though the VFP help only tells of 1427 and 1429.
- More COM error information can be obtained using the a Error function. The VFP documentation for a Error states that the 7th element of the returned array is the OLE 2.0 exception number but when using the MSComm32 control I noticed that this value was always 0 and that the 6th element was the one that matched the error constants listed in the control help documentation.
- But for the most part, COM errors are befuddling, cryptic, and only occasionally is the error message valuable for debugging.
- Some errors are not technically COM errors but are errors that pertain to a particular application. For example the MSComm control does not cause Error method code to fire when a Framing error occurs but raises it as the CommEvent constant passed to its OnComm event. These errors probably will not cause programs to crash but may cause problems with the performance of controls.
- From Doug Hennigs Error Handling Paper
Prior to VFP 6, VFP Automation servers couldn’t properly return an error condition to their callers. That’s changed with the addition of the comreturnerror() function. This function populates the COM exception structure with information about the error that occurred. It accepts two parameters: cExceptionSource, which is the name of the server, and cExceptionText, any message you want to return.
See also
COM,
COMReturn Error
Contributors:
Todd Chandler
Category Error Handling Category C _ O _ M