Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Advantages of using COMRETURNERROR( )
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00469402
Message ID:
00469534
Vues:
31
Hi!

My guess was about usual use of COMRETURNERROR(). For example, at the server side, when SQLExec command failed, take information from aerror array and return from routine using COMRETURNERROR. At the client side than we can see that query failed and why it is failed. No error handling involved here at the server side.

As about error, COM server does not crashes when error occurs and error event fired. More, COMRETURNERROR() returns control inmmediately to the client. Thus I consider this function have little of use for error handling at the server side, just a tool to report error to the client from server using some standard and strateforward approach.

>>The advantage is that you have only one query to remote COM object (call funtion and get error in aerror() funtion). Compare this to the way when you need to query COM object 2 times - one to call function, second (or more) to ger error message from COM object. When working through DCOM and Internet (thing client), number of queries to remote object is very important, because each query requires a lot of time despite little data transfer. When all data transferred in a single query, this lasts much less time. When working locally or in the LAN, this makes no differense, but better to use this standard for case when you will scale your application to workk through internet.
>>
>>>Is there any advantage to using COMRETURNERROR( ) instead of passing the error number and error message back using custom properties?
>>>
>>>Is adherence to the COM standard the only advantage?
>A guess:
>If the client trapped a server error with client's ON ERROR, would not the server (com) crash /already be crashed?
>COMRETURNERROR (i think) is a server side service, that allows the server (com) to reset itself when it fails. It can return an AERROR() and server messages to a client's ON ERROR routine.
>So the answer may be that COMRETURNERROR allows a COM to reset itself after an error. It maybe only appropriate to COM development. COM is not aware of the client's subroutines. COM only knows his space. COM knows that Client has all the fun:-)
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform