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:
00527503
Views:
35
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