Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling in a COM server
Message
From
16/04/2008 17:23:24
 
 
To
16/04/2008 17:11:20
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01311297
Message ID:
01311301
Views:
17
Look at COMRETURNERROR() in VFP help.

>I could use a simple explanation of how to deal with error handling in a COM server dll. My server is patterned after the Rick Strahl's whitepaper on the subject. As such it includes a property (lError) and a function
>
>function error
>lparameters nError,cMethod, nLine
>this.cErrorMessage = ""
>this.cErrorMessage = this.cErrorMessage + "<br>Error No: " + str(nError)
>this.cErrorMessage = this.cErrorMessage + "<br>Method: " + cMethod
>this.cErrorMessage = this.cErrorMessage + "<br>Line No: " + str(nLine)
>this.cErrorMessage = this.cErrorMessage + "<br>Message: " + message() + message(1) + "<HR>"
>endfunc
>
>The other functions in the server include:
>this.lError = .F.
>which initializes the property. Now, what I don't quite understand is what triggers the error function and how do you get cErrorMessage returned to the calling routine, in this case it would be an ASP page. Rick tried to explain this to me but frankly the answer was too cryptic for my simple mind.
>
>My other question is if this is the best way to handle the whole error handling business, or would it be better to use TRY/CATCH syntax in the actual server functions?
>
>Some general instruction on this subject would certainly be appreciated.
>Thanks
>- Don
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform