Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Registered dll file in VFP
Message
From
29/05/2008 21:52:51
Hee Lim Wang
Fantasy Software Enterprise
Malaysia
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01320248
Message ID:
01320459
Views:
19
*File: RegisterControl.prg
*-- This function registers an OCX/ActiveX control
* or set of OCX/ActiveX controls based on the
* name of file.
*-- Note: It works for OLE servers too.

FUNCTION RegisterControl
*-- Parameters:
* tcFileName = the name of the file that contains
* the control(s), including the path.
*-- Returns:
* Logical TRUE if successful, FALSE otherwise.
* Also returns FALSE if the file doesn't exist.
*-- Call sample:
* llRegistered = RegisterControl("c:\windows\system\comctl32.ocx")

LPARAMETERS tcFileName
LOCAL llSuccess

IF FILE(tcFileName)
DECLARE INTEGER DllRegisterServer ;
IN (tcFileName) ;
AS __DllRegisterServer__
*-- This function returns 0 if successful
IF __DllRegisterServer__() = 0
llSuccess = .T.
ELSE
llSuccess = .F.
ENDIF
ELSE
llSuccess = .F.
ENDIF

RETURN llSuccess


*File: UnregisterControl.prg
*-- This function unregisters an OCX/ActiveX control
* or set of OCX/ActiveX controls based on the
* name of file.
*-- Note: It works for OLE servers too.

FUNCTION UnregisterControl
*-- Parameters:
* tcFileName = the name of the file that contains
* the control(s), including the path.
*-- Returns:
* Logical TRUE if successful, FALSE otherwise.
* Also returns FALSE if the file doesn't exist.
*-- Call sample:
* llUnregistered = UnregisterControl("c:\windows\system\comctl32.ocx")

LPARAMETERS tcFileName
LOCAL llSuccess

IF FILE(tcFileName)
DECLARE INTEGER DllUnregisterServer ;
IN (tcFileName) ;
AS __DllUnregisterServer__
*-- This function returns 0 if successful
IF __DllUnregisterServer__() = 0
llSuccess = .T.
ELSE
llSuccess = .F.
ENDIF
ELSE
llSuccess = .F.
ENDIF

RETURN llSuccess
Previous
Reply
Map
View

Click here to load this message in the networking platform