Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check that a OLE server was correctly instanciate
Message
From
03/03/2000 10:10:17
 
 
To
03/03/2000 07:45:09
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00338617
Message ID:
00341237
Views:
35
>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
Map
View

Click here to load this message in the networking platform