IIS Development

IisDev

>  Home
>  News
>  Notification Service

 

Articles

>  Code Samples
>  ASP.NET
>  Security

 

Components & Tools

>  Free Components
>  SharpDevelop
>  ComponentCenter
>  CodeLook Program

 

Service

>  Links
>  Advertising
>  Contact us

Search IISDEV:

RegServer 1.0 - free

Last updated: 11/22/99, v1.0 (Initial Release)


Though it isn't a task you usually would perform via ASP (for remote administration it is cool anyway), component registration is important nowadays: much functionality can be added to your Web site using components. To ease installation, I have created a small maintenance component that mimics the regsvr32 utility in that it allows to register and unregister components.

The RegServer component works in all Automation enviroments (ASP and WSH, for example) and it also comes with a type library included, so you can even easily call it from within C++ programs. It is apartment threaded (for those who want to know the most intimate details...)

Samples

The first thing in a component's life is to register it (before you can use it). To complete this task, all you have to do is to call the Register method. It takes the component's path as parameter, and returns a boolean value for the return value. Detailed errors are raised when the registration fails.

<%
    Const fDll2Register = "d:\Daten\Projekte\aspregsvr\debug\aspregsvr.dll"

    On Error Resume Next

    Set xObj = CreateObject("AlphaSierraPapa.AspRegSvr")
    retval = xObj.Register(fDll2Register)
    
    If Err.Number <> 0 Then
        Response.Write Err.Description & "<br>Error Number: " & Err.Number
    Else
        Response.Write "Successfully registered " & fDll2Register
    End If
%>

There is only one additional method for the RegServer component: Unregister. It does what the name implies, and it takes the same parameter:

xObj.Unregister(Server.MapPath("COM.dll")

Note: When using the RegServer component in ASP pages, ensure that the user has sufficient rights to write to the Registry!

Installation and Download

Before using the component you have to register it using the regsvr32 utility:
   regsvr32 aspregsvr.dll.

Download (size is approx. 19KB)
The most current version number of the component is 1.0. It is compiled with Visual C++ 6.0 SP3 using ATL.

 

©1998-2004 Christoph Wille. All rights reserved.
All content and images on this site are copyright. Reuse (even parts) needs our written consent.