*ALWAYS* use COMRETURNERROR in your error handler. It's one of those things that should be built in automatically so that you don't have to think about it, but it isn't.
FUNCTION Error(nError, cMethod, nLine)
COMreturnerror(cMethod+' err#='+str(nError,5)+'
line='+str(nline,6)+' '+message(),_VFP.ServerName)
>Hello,
>
>I have a VFP8 MTDLL. Inside are various functions. One of the functions is an ErrorProc to handle errors. When I attempt to set ON ERROR DO ErrorProc or ON ERROR This.ErrorProc or ON ERROR DO This.ErrorProc I get an Error (??).
>
>How does one set up an Error handler from within a COM environment?
>
>Thanks
>
>David