Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for COM server ?
Message
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00798846
Message ID:
00798884
Views:
31
Sergey,
I have a follow-up question. Your suggestion to check for the COM server works very well, but I was wondering about something.

Initially, before I posted a message here, I was checking for COM server as follows:
poGpmPager = createobj("Pager.Send")
if !type("poGpmPager") = "O" or isnull( poGpmPager )
   =messagebox( "problem" )
endif
But it didn't work and I was getting error on "createobj" line.

I am wondering, why the syntax above does not work but when you add square brackets [] around createbobj, it works?

With addition of your code, now the program creats the object twice: one time to check for COM server registration and another one for actually creating the object. It's not a big deal but I thought that it would be nice to improve the speed by combining both in one. Actually as I type this message I am thinking that maybe I should use brackets [] when creating the object to make it all in one call. I will try it now.

>You're welcome.
>
>>Thank you very much for your help, Sergey.
>>
>>>Dmitry,
>>>
>>>
? TYPE([CREATEOBJECT("mydll.mycomclass")]) = "O"     && will return .T. if it is registeredf
>>>
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform