Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Register OCX automatically
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00526982
Message ID:
00527743
Views:
33
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform