Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On error in com Server
Message
De
21/03/2003 07:06:00
 
 
À
21/03/2003 03:36:07
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00768470
Message ID:
00768500
Vues:
11
Thanks. What puzzled me is that the phrase "Your .exe automation server can trap for these errors with an ON ERROR routine" , so I mistakenly thought that server itself somehow traps the error and runs certain termination routine, which probably doesn't make sense , if possible at all.


>I think the help file suggest to run the sys(2335,0) as soon as possible when running an EXE automation server in unattended mode. The error can be handled by ON ERROR where ever you set the exception handler(ON ERROR). I noticed you set it in a method, which is ok but you may want to restore the ON ERROR back to the way it was before leaving the method. I believe this would be the suggested way:
>
>
>&& Compile this as a exe com server in one project
>Local oRetrieval as retrieval
>SYS(2335,0)
>ON ERROR do errHandler(program(), message())
>oRetrieval = CREATEOBJECT("DLLNAME.Retrieval")
>oRetrieval.ftsearch(lkeyWord, lPath, ltable) && Where ever these params came from
>ON ERROR
>Return
>FUNCTION errHandler(sProgram, sMessage)
>&& Do something with params
>ENDFUNC
>
>
>
>&& Compile as a MT Com Dll in another project
>DEFINE CLASS retrieval AS CUSTOM OLEPUBLIC
>
>...
>
>  FUNCTION ftsearch( lkeyword , lpath, ltable )
>  ON ERROR do errhandler
>...
>
>Atleast this is the way I've used it many time with out a problem. I hope this help.
>
>BW
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform