Message
De
29/05/2008 21:52:51
Hee Lim Wang
Fantasy Software Enterprise
Malaisie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Divers
Thread ID:
01320248
Message ID:
01320459
Vues:
21
*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
Précédent
Répondre
Fil
Voir