Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check to see if Word is installed
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00445354
Message ID:
00445554
Views:
20
*snip*
>Alex (and Larry too),
>
>There's a number of ways to check to see if the user has blown away the application. For example, you could check the registry for the application, get the CLSID and then use that to find the LocalServer. Additionally, you could use FindExectutable() in Shell32 and then check for the presence of the file returned. This is just a personaly prefence. I hate having to rely on the error handler to check the validity of these things.

It is a matter of personal preference. To go through the process of finding the registry entry by ProgID, get the CLSID, locate the appropriate registry key for that, retrieving the InProcServer and checking its existence seems "above and beyond" to me. Of course, if you already have a function (or class method) that does this, it's no big deal. ;-) I haven't invested the time to create one, so using an ON ERROR wrapper for createobject() is much easier.

I still think you need to trap for an error because the same "eager beaver" we were discussing earlier could have deleted or moved the support/dependency files (e.g. VFP runtime files). This would also cause the COM server to fail but the registry check would pass.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform