COM Q&A

  1. What is COM-object?:

    Details

    COM-object term is a run-time definition. It is an instance of a class.

  2. What is binding, what types of binding COM uses?:

    Details

    The term binding refers to a set of steps how COM-client access methods of COM-server. (Use of older terms as ActiveX client and server, Automation client and server is also appropriate ). Access to COM-server function by COM-client is more complex then regular call to function in most programming languages. This is because internally an COM-client access server's methods by numerical IDs, not by function names. COM distinguishs types of access to COM-server properties as types of binding. Once type was choosen it is fixed and binding is set. There are two major types of binding: binding by IDispatch interface and VTBL binding. When COM client/server written in C++ client can use VTBL type of access to server's interface methods and this is the fastest way. There are two types of binding when client uses IDispatch interface. If a client knows numerical ID of server's method, called DISPID, then a client can directly call Invoke method of IDispatch interface to access server method. This is called early binding because call to method binded at compile time, not at run time. Another term for early binding is ID binding. If COM-server provides type library, then COM-client can read the library to get dispatch identifiers. It means that when a client uses IDispatch interface provided with type library, client actually using early binding. Late binding as opposite to early binding is slower. In order to address to Invoke function with DISPID of a method, late binding use additional step to get the DISPID by GetIDsOfNames function of IDispatch interface using string name of function. Binding is done at run time, it is later then at run-time.

  3. What is dual interface?:

    Details

    Dual interface supports both a binding through IDispatch interface and early binding through VTBL.

  4. How to delete COM DLL installed under IIS? Why regular delete does not work?:

    Details

    Any DLL installed under IIS is running in the process of IIS, unless it is configured with Internet Service Manager to run in a separate process. Therefore IIS locks DLL while it is running. The only way to unlock and delete DLL by regular way is to kill IIS process inetinfo.exe. Just run:

    net stop iisadmin /y

    from command prompt. The command stops all IIS-related services in one pass - IIS Administaration Service and its dependants:

    WWW Publishing Service
    FTP Service
    SMTP Service

    If DLL was not used additionally by some other process ( like SQL Server process ), it can be deleted now. New version of DLL can be installed and IIS service should be restarted:

    net start w3svc

    ( w3svc as dependant service starts iisadmin service automatically as its parent ).

    Notefully if a company has only one production web server it pose a serious problem. When old DLL under IIS must be replaced with a new version, the web server will not be active for short maintenance time. If it is no way acceptable like on web sites with heavy traffic, the company should have at least two production web servers and switch it in time of maintenance.

© (c) 2001, Stanislav Malevanny