Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ActiveX registering
Message
From
18/02/2005 09:11:48
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
 
 
To
18/02/2005 09:05:31
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00988275
Message ID:
00988277
Views:
30
Hi David,

This works for me.

IF !THISFORM.chkclass("mscomctl2.dtpicker")
* control not registered - copy the control to Sys32 and register it
IF MESSAGEBOX("Some PPAgent components are not registered, would you like to register them now?",36,"PPAgent Warning") = 6
* try and register the control
* copy the file to the windows\sys32 folder
lcWindir = ADDBS(THISFORM.getwindir())

IF !FILE((lcWindir + "mscomct2.ocx"))
COPY FILE (ADDBS(THISFORM.appdir) + "mscomct2.ocx") TO (lcWindir+"mscomct2.ocx")
ENDIF
IF !THISFORM.regclass(lcWindir+"mscomct2.ocx")
lcMsg = "Unable to register key components please contact Infosupport."
ENDIF
ELSE
lcMsg = "PPAgent cannot load as some components are not registered."
ENDIF
ENDIF

** chkclass
PARAMETERS p_class

#DEFINE HKEY_CLASSES_ROOT -2147483648
#DEFINE ERROR_SUCCESS 0 && OK

IF EMPTY(p_class)
RETURN .F.
ENDIF

LOCAL lnKey

DECLARE Integer RegOpenKey IN Win32API ;
Integer nHKey, String @cSubKey, Integer @nResult

DECLARE Integer RegCloseKey IN Win32API ;
Integer nHKey

lnKey = 0
llRetVal = ( RegOpenKey(HKEY_CLASSES_ROOT, p_class, @lnKey) = ERROR_SUCCESS )
IF llRetVal
RegCloseKey(lnKey)
ENDIF



HTH

Jon

>My application uses an ActiveX control. When I put the application on all the computers in the office how can I register or be sure the ActiveX control will work on each computer. Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform