Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Poistion of OCX control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00791048
Message ID:
00791172
Vues:
11
>I need to know where is installed an ocx file used by my application to verify the installed version. Normally it is in a particular folder,but sometimes it can be found in other position.
>
>Thanks

Pass the ProgID (such as MSComDlg.CommonDialog.1) to the following function:
Function GetSrvr
* Author: George Tasker
* Date: July 19, 2000 - 11:45 AM
* Purpose: Retrieves the file location
* of an in process OLE automation server
* ActiveX control

LPARAMETER pcServer && The ProgID

#INCLUDE REGISTRY.H
LOCAL oReg, lcresult, lcCLSID, lnerr
lcresult = ""
SET CLASSLIB TO REGISTRY ADDITIVE
oReg = CREATEOBJECT('Registry')
RELEASE CLASSLIB REGISTRY
IF oReg.OpenKey(pcServer + '\CLSID') = ERROR_SUCCESS
  lcCLSID = ""
  lnerr = oReg.GetKeyValue('', @lcCLSID)
  IF lnerr = ERROR_SUCCESS
    oReg.CloseKey()
    lckey = "Software\Classes\CLSID\" + lcCLSID + "\InProcServer32"
    IF oReg.OpenKey(lckey, HKEY_LOCAL_MACHINE) = ERROR_SUCCESS
      lcresult = ""
      = oReg.GetKeyValue('', @lcresult)
      oReg.CloseKey()
    ENDIF
  ENDIF
  oReg.CloseKey()
ENDIF
RETURN lcresult
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform