Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling in a COM server
Message
From
16/04/2008 17:52:04
 
 
To
16/04/2008 17:23:24
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01311297
Message ID:
01311310
Views:
17
Thanks Craig. I had read that before and I hate to say its still pretty greek to me. The help fails to provide an example that would be really helpful. AS I read it, we would still need something to trigger the COMRETURNERROR() call. What would that be? and how would we access the returned value from an ASP page?

>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform