Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error handling in a COM server
Message
De
16/04/2008 17:23:24
 
 
À
16/04/2008 17:11:20
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01311297
Message ID:
01311301
Vues:
18
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform