Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This interface defines two methods: one for dynamically loading new DLL servers into an existing surrogate, and one to free the surrogate when it is no longer needed.

A surrogate is an EXE process into which a DLL server can be loaded to give the DLL server the advantages of an EXE server without the coding overhead. It can also allow independent DLL servers to be located together within a single process, reducing the total number of processes needed.

DLL servers are easy to write using standard development tools and running them in a surrogate process provides the benefits of an executable implementation, including fault isolation, the ability to serve multiple clients simultaneously, and allowing the server to provide services to remote clients in a distributed environment.

When to Implement

If you are using the system-supplied surrogate, which implements this interface, you do not need to implement it specifically. All surrogate processes must implement this interface, so if you are writing a custom surrogate, you must implement it along with the IUnknown, IClassFactory, and IMarshalinterfaces.

When to Use

In general, you would not call the methods of ISurrogatedirectly. COM calls the ISurrogate::LoadDllServermethod when there is an activation request for a class registered with the DllSurrogate named-value. COM also calls ISurrogate::FreeSurrogatewhen all DLL servers running in the surrogate have terminated.

Methods

The following table shows the methods for this interface in the order that the compiler calls the methods. Like all COM interfaces, this interface inherits the methods for the IUnknowninterface.

IUnknown method Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

ISurrogate method Description

LoadDllServer

Creates an uninitialized object.

FreeSurrogate

Locks object application open in memory.

Remarks

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also