>Hi all,
>
>How do I detect within a VFP program if an Activex control has been
>registered successfully on a Windows machine (NT4 and WIN 2K) and if it does
>not exist in the machine, how do I register the control programmatically
>within a VFP program?
>
>We are still using VFP5. We are trying to upgrade an VFP program with
>a newly purchased calendar activex control. There are about 50 machines
>already running the application.
>
>Thanks.
>
Kam,
To answer the first question, use the Registry.prg that came with VFP 5.0, like this
SET PROCEDURE TO Registry ADDITIVE
oReg = CREATEOBJECT('Registry')
? oReg.IsKey(< ProgID >)
While I don't recall if the program version of the registry class had this function (the vcx version does), there is a work around if it doesn't.
? (oReg.OpenKey(< ProgID >) = 0)
If it the key exists, the value will be true. You'll then have to close the key according. Otherwise, as I'm sure Sergey's response points to, you can use DLLRegisterServer, in the OCX after copying the control to the system directory.
George
Ubi caritas et amor, deus ibi est