PRB: COMRETURNERROR() Only Works Properly if Error Has Occurred (259211)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q259211 SYMPTOMS
The COMRETURNERROR() function populates the COM exception structure with information that Automation clients can use to determine the source of Visual FoxPro Automation errors. However, if this function is called without an error having occurred, it does not properly populate the structure. Visual FoxPro clients display the information that was sent, but other clients may display only a generic "Automation Error" message.
RESOLUTION
One resolution to this problem is to always call the COMRETURNERROR function from the Error method of your Automation server. The ERROR cErrorMessage command throws Error 1098 (User-defined error) when used. You can test for this in the Error method and call the COMRETURNERROR function with the cErrorMessage command.
STATUS
This behavior is by design.
REFERENCES
For more information about COMRETURNERROR(), the ERROR command, or building COM servers, please see the Visual FoxPro documentation.
Modification Type: | Major | Last Reviewed: | 4/12/2000 |
---|
Keywords: | kbCodeSnippet kbDSupport kbprb KB259211 kbAudDeveloper |
---|
|