>>>Is there a VFP command or a DELCARE dll Windows method to check to see if a ActiveX (ocx) is registered and returns a true/false if registered or not?
>>>
>>>I want to check if Adobe Acrobat pdf.ocx is registered before attempting to use the OCX. How can this be done without generating a VFP error. I tried using CREATEOBJECT("PDF.Pdfctrl.1") which, if pdf.ocx is registered, returns an Object; however, if it's not installed, CREATEOBJECT() produces an error.
>>>
>>>Any ideas?
>>>
>>Joel,
>>
>>If you use the Registry class that comes with the FFC, create the registry object, then use the IsKey() function, passing it the ProgID. It will return a logical value indicating whether or not it's registered.
>
>Try this:
>
>If type('CreateObject("fmfaxapi.Application")')="O"
> oFax = CreateObject("fmfaxapi.Application")
>Else
> Messagebox("Fax library not installed.")
> Return
>Endif
That'll only tell you if the object has been instantiated, not if it's registered. An alternate solution is to try to instantiate the object, and let the error handler deal with failure caused by the control not being installed.
George
Ubi caritas et amor, deus ibi est