Storages & Files RegSvr32
RegSvr32 method 

Registers a COM DLL with the system.

Syntax:

variable = object.GetSpecialPath(dllFile, boolRegUnreg)

Parameters:

dllFile - Full path to the COM DLL file to register

boolRegUnreg - Boolean - if True register the DLL, if False the DLL will be unregistered.

Examples:

Set sf = Server.CreateObject("newObjects.utilctls.SFMain")
' Register a DLL you brought with the ASP file
sf.RegSvr32(Server.MapPath("MyCOMDLL.dll",True)

Remarks:

If the registration/unregistration fails an error will occur. This method actually invokes the COM DLL's DLLRegisterServer and DllUnregisterServer functions to do the job.

If you are writing an install/setup application it is recommended to use also GetSpecialPath method and the file copy functions in order to choose good place for the DLL, copy it there and register it from that location. In such cases you will also take care to check if the DLL already exists and what version is there on the system (you can use GetVersionInfo method, and the ConfigFile component to read data from the registry). A good sample on checking for component existence is distributed with Active Local Pages product (Test PC sample).

Applies to: SFMain object

Supported on:

Windows 95/NT and later
Windows CE 3.0 and later
Pocket PC/Windows Mobile 2003 and later
Windows CE.NET 4 and later

 

newObjects Copyright 2001-2006 newObjects [ ]