PRIVATE goRegistryObject LOCAL lcCompName, lcClass, lcFileType, llRetCode #INCLUDE registry.h gnMsgBoxButtons_OK = 0 gnMsgBoxButtons_OKCancel = 1 gnMsgBoxButtons_AbortRetryIgnore = 2 gnMsgBoxButtons_AbortRetryCancel = 2 gnMsgBoxButtons_YesNoCancel = 3 gnMsgBoxButtons_YesNo = 4 gnMsgBoxButtons_RetryCancel = 5 gnMsgBoxIcon_StopSign = 16 gnMsgBoxIcon_Question = 32 gnMsgBoxIcon_Exclamation = 48 gnMsgBoxIcon_Information = 64 gnMsgBoxReply_OK = 1 gnMsgBoxReply_CANCEL = 2 gnMsgBoxReply_ABORT = 3 gnMsgBoxReply_RETRY = 4 gnMsgBoxReply_IGNORE = 5 gnMsgBoxReply_YES = 6 gnMsgBoxReply_NO = 7 goRegistryObject=NEWOBJECT( "registry", "registry.prg" ) IF VARTYPE( goRegistryObject ) <> "O" WAIT "ERROR: Unable to create registry object" WINDOW RETU ENDIF IF ! IsRegistered( "commtools" + "." + "modem" ) TryToRegister( "commtools", "modem", "OCX" ) ENDIF IF ! IsRegistered( "ppcSettl" + "." + "Settlements" ) TryToRegister( "ppcSettl", "Settlements", "DLL" ) ENDIF IF ! IsRegistered( "ppcDialup" + "." + "DialupConnection" ) TryToRegister( "ppcDialup", "DialupConnection", "DLL" ) ENDIF IF ! IsRegistered( "ppcTcpIP" + "." + "TcpIPConnection" ) TryToRegister( "ppcTcpIP", "TcpIPConnection", "DLL" ) ENDIF IF ! IsRegistered( "ppcFTP" + "." + "FTPConnection" ) TryToRegister( "ppcFTP", "FTPConnection", "DLL" ) ENDIF RELEASE goRegistryObject RELEASE ALL RETURN FUNCTION IsRegistered PARAMETERS pcComponentAndClassName LOCAL llRetVal llRetVal=.F. llRetVal=goRegistryObject.IsKey(pcComponentAndClassName,HKEY_CLASSES_ROOT) RETURN( llRetVal ) * FUNCTION TryToRegister LPARAMETERS pcComponentName, pcClassName, pcFileType LOCAL llRetCode, lcMsgBoxTitle, lcMsgBoxText llRetCode = RegisterComponent( pcComponentName + "." + pcFileType ) llRetCode = goRegistryObject.IsKey( pcComponentName + "." + pcClassName, HKEY_CLASSES_ROOT) IF ! llRetCode ************************************************************************************* ** You will have to substitute something different for the call the UDF "msgbox" ** ************************************************************************************* MSGBOX( "Component not properly registered : " +pcComponentName + "." + pcFileType , "Initialization", gnMsgBoxButtons_OK + gnMsgBoxIcon_Exclamation ) ENDIF RETU( .T. ) * FUNCTION RegisterComponent LPARAMETERS pcComponentAndFileType LOCAL lcPathAndName, lcDriveAndPath, llRetVal lcDriveAndPath = SYS(5) + SYS(2003) + "\" lcPathAndName = lcDriveAndPath + pcComponentAndFileType RUN /N REGSVR32 /S &lcPathAndName RETURN( .T. )