Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trapping error inside a COM
Message
 
À
12/02/2002 16:36:50
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00619153
Message ID:
00619195
Vues:
15
>I am trying to catch errors while running the COM object...


You need an ErrorProc. Try something like this.
Should give You an error message as well as
a written Protocol.
    PROCEDURE Error(nError, cMethod, nLine)
        
        cErrStr = CRLF +"Error #: "+ TRANS(nError) + CRLF + ;
                  "Method Name: "+ cMethod + CRLF + ;
                    "On Line: "+ TRANS(nLine) + CRLF + ;
                     "Message: "+ MESSAGE() + CRLF + ;
                  "DateTime: "+ TTOC(DATETIME()) + CRLF + CRLF

        =STrTofile(cErrStr, "ERRORS.TXT", 1)

        ComReturnError(cMethod, cErrStr)

    ENDPROC
HTH

Frank
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform