General information
Category:
Coding, syntax & commands
>Thanks for jumping in Kim, but unfortunatly, VFP cannot raise event :(
>PMFJI. I believe you need to raise an error in the COM component if something is wrong rather than returning .F. (using the Err.Raise method) and this error can then be trapped in the calling program with an On Error statement. I have pasted some sample code below. This is code for VB, can this be done in VFP?
Of course you can!
I believe the error event it's the only one you can raise in VFP. Unfortunately the ERROR keyword won't help with COM components.
What you have to do in that case is, whenever you know something bad happened in your COM component (or an unexpected error), expose to the caller layer with COMRETURNERROR(). Use a class that implements the Error method and put the COMRETURNERROR call there.
Or, it would be simpler to evaluate "If myObject Is Nothing Then".
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only