Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FAQ: How to register/unreg an OCX programatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00080733
Message ID:
00080774
Vues:
37
>I came across an FAQ titled "How to register/unregister an OCX/ActiveX programatically" by Paul Vlad Tatavu. To call the function, you need the WINDOWS\SYSTEM path:
>
>llRegistered = RegisterControl("c:\windows\system\comctl32.ocx")
>
>I was wondering if there is a way in VFP to get the path to the users WINDOWS\SYSTEM directory where the OCX's reside. I know on some PC's, the path is not always WINDOWS\SYSTEM because the user changed the name at install. I have seen some named WIN95\SYSTEM. Is there a way to capture this path in VFP like a lot of the installation software programs do?
>
>TIA,
>
>James

James,

I believe that some system directories are named SYSTEM32 (on NT). To get the system directory, use the following
DECLARE INTEGER GetSystemDirectory IN Win32API;
  STRING @lcbuffer, INTEGER uSize
* Set the buffer size equal to MAX_PATH
lcbuffer = SPACE(260)
lnsize = LEN(lcbuffer)
lnsize = GetSystemDirectory(@lcbuffer, lnsize)
IF lnsize > 1
  * If this fails, something is terribly wrong
  lcbuffer = LEFT(lcbuffer, lnsize)
ENDIF
hth,

George
George

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

Click here to load this message in the networking platform