Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On error in com Server
Message
De
21/03/2003 03:36:07
 
 
À
21/03/2003 02:24:00
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00768470
Message ID:
00768477
Vues:
17
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform