Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check that a OLE server was correctly instanciate
Message
From
29/02/2000 13:53:57
 
 
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00338617
Message ID:
00339330
Views:
39
Hi Ed,

I wanted to know if there is another way of checking that the COM did instanciate correctly.

My COM is built in VFP. In it's Init() event, I may return .F. if something is wrong. Like you know, this will prevent the COM from instanciating. In VFP, I would write this code:
loCOM = NewObject("MyCOM.MyClass")
IF VarType(loCOM) = "O"
   *-- Use loCOM here
ELSE
   *-- Display error message
ENDIF
I was wandering if there is a similar approach in VB. In my test, if my COM return .F. in it's Init() event, VB throw an error on the line:

Set loCOM = New MyCOM.MyClass

Is there another way than using On Error in this case?

TIA
>My guess is that it's how he's handling errors in VB; ordinarily I'd trap the failed instantiation by wrapping the SET in an in-line error handler, but I'm far from a VB expert.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform