Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for DLL Registration Before Using CreateObject(
Message
From
17/03/2003 14:46:47
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00766669
Message ID:
00766678
Views:
18
A trick I have chosen to use is to create a class that accepts the character string you would use in the createObject call (i.e. "Excel.Application") as a parameter and try to call createObject. I put code in the error method of the class to return .f. on error. If it creates the object successfully, it releases it and returns .t. You could also choose to just return the object, but I prefer to keep the return type as logical and just grab the object again.

The code would look something like this in use:

if isRegistered("Excel.Application")
oExcel = createObject("Excel.Application")
endif
Paul A. Busbey
Victoria Insurance
Previous
Reply
Map
View

Click here to load this message in the networking platform