Michael,
You can use ERROR() event of your class.
>VFP7 documentation states
>
>
>SYS(2335 [, 0 | 1])
>Return Values
>Character
>
>Parameters
>0
>Enables unattended mode. When unattended mode is enabled, a Visual FoxPro error is generated whenever a modal state occurs. Your .exe automation server can trap for these errors with an ON ERROR routine.
>>
>Can't figure out how to use this ON Error in automation server
>
>something like
>
>DEFINE CLASS retrieval AS CUSTOM OLEPUBLIC
>
>...
>
>FUNCTION todosearch( lkeyword , lpath, ltable )
> ON ERROR do terminate
> =SYS(2335,0)
> ...
>ENDFUNC
>
>PROCEDURE terminate
> RETURN
>ENDPROC
>
>ENDDEFINE
>
>obviously results in error
>OLEDispatch Exception 1 from: file terminate.prg does not exist
>Should I create a separate terminate.prg ?
>
>TIA
>Michael
--sb--