Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Register DLL or OCX programmatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00474160
Message ID:
00474165
Vues:
24
>How can I register my DLL or OCX programmatically in VFP?
>
>run regsvr32.exe mydll.dll
>
>A Messagebox will promptfor success or failure from the dos prompt. I need to capture the result in VFP so that I know if the registration succeced.
>
>
>DO I need to use API call to register DLL in order to accomplish above task?
>
>Thanks

ActiveX and COM servers have an internal function that does the registration named DllRegisterServer() and another, DllUnregisterServer() that handle registration and unregistration. The following function takes the fully qualified filename of the server and attempts to register it.
FUNCTION RegisterServer
  
  LPARAMETER tcFileName

  LOCAL lnresult
  DECLARE INTEGER DllRegisterServer IN (tcFileName)
  lnresult = DllRegisterServer()
  RETURN lnresult
ENDFUNC
If the function succeeds, it will return zero. Otherwise, an error occurred and the return value represents the error number. Note that the above does no checking for the actual existence of the file.
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