Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trapping error inside a COM
Message
 
To
12/02/2002 16:36:50
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00619153
Message ID:
00619195
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform