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:
00527782
Views:
31
HI Gerard!

The below code works in Win95/98/NT and I used it in my application. Im not pretty sure if it will work in Win2000, anyway, you may try it and see the result!!!

Thanks,

Joe

>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
Joe Mamokan
Database Specialist
Email Address: mamokan@eudoramail.com
Url Address: http://visnet_dd.tripod.com
"Can you VISUALIZE Quick Data Access"
Cell # +639172482033
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform