COM Server

A COM Server object represents a COM server registration or unregistration. It is used to specify the executable file (DLL or .exe) that contains the server implementation for a COM class. Registration or unregistration of a COM server is controlled by its component and its executable file:

Situation Action
Not linked to a component The COM server is registered if its executable file is installed.
Linked to a component The COM server is registered if its component is installed.

See COM classes for more information.

Tip: Many DLL-based COM servers have a DllRegisterServer entry point that will register the COM class(es) implemented by the server. If your COM server implements that entry point, you might find it more convenient to register the COM server by specifying Use DllRegisterServer in the file's Registration attribute. In that case, you don't need to register the COM class or its servers and verbs separately.

Attributes

The following attributes and options are available.

Attribute Description
Server type

Select the server's execution context from the drop-down list. The following choices are available:

Context Description
InProcHandler The COM Server object registers the 16-bit in-process handler for a COM class that is implemented by an out-of-process server (defined by a separate LocalServer COM server object). You should set Server path to ole2.dll for this context, unless you provide your own handler.
InProcHandler32 The COM Server object registers the 32-bit in-process handler for a COM class that is implemented by an out-of-process server (defined by a separate LocalServer32 COM server object). You should set Server path to ole32.dll for this context, unless you provide your own handler.
InProcServer Server is a 16-bit in-process DLL.
InProcServer32 Server is a 32-bit in-process DLL.
LocalServer Server is a 16-bit out-of-process executable.
LocalServer32 Server is a 32-bit out-of-process executable.
Threading

Select the threading model for the in-process server from the drop-down list. This option only applies if Context is set to InProcServer32. The following choices are available:

Threading model Description
Apartment The server must run in a single-threaded apartment.
Free The server must run in a multi-threaded apartment.
Both The server may run in any apartment.
Neutral The server must run in the neutral apartment. (Only available on Windows 2000 and later.)
Server path Enter the path to the COM server, or click ... (browse) to open the Select Installation File or Folder dialog box that allows you to browse for the desired file.
Store as file name only Check this box to register Server path as a file name only; clear it to register it as a full path (if indeed it contains a full path). By registering only the server name (instead of the full path), an application-relative server can be registered for a given COM class and different applications can use different servers for the same class.
Arguments Enter the command line arguments for the server executable, or leave empty if no command line arguments are required. This option only applies if Context is set to LocalServer or LocalServer32.

Related topics

COM classes, Working with attribute panes