Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Register OCX automatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00526982
Message ID:
00527743
Vues:
34
Ismael, thanks foe your reply.
Do you know if this code works in Win95/98/NT and 2000 ?

Regards,

Gerard





>Hi!
>
>try the this code:
>
>-------------------------------------------------
>
>cOCXFile= getfile("DLL|OCX")
>if ThsNotOcx(cOCXFile) = .f.
> wait window "nOT YER REGISTERED"
> return .f.
>endif
>
>*ENDIF
>
>function ThsNotOcx
> lparameter pRegOcx
> public glError
> glError=.f.
> local frmOLETest, lcText, lReturn, lcError
> lReturn = .t.
> frmOLETest = createobject('Form')
> lcError = on('ERROR')
> on error store .t. to glError
> frmOLETest.addobject('OCXTest', 'OLEControl', pRegOcx)
> on error &lcError
> if glError
> if ThsRegOcxDll(pRegOcx)# 0
> lReturn = .f.
> endif
> endif
> frmOLETest.release()
> frmOLETest=null
> clear typeahead
> release glError
> return lReturn
>endfunc
>
>function ThsRegOcxDll
> lparameter pRegOcx
> local lcRegOcx, lnRetOcx
> lnRetOcx = 1
> lcRegOcx = pRegOcx
> if file(lcRegOcx)
> declare integer DllRegisterServer in (lcRegOcx) as __DllRegisterServer__
> lnRetOcx = __DllRegisterServer__()
> endif
> return lnRetOcx
>endfunc
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform