Collapse the table of content
Expand the table of content

ISurrogate interface

Used to dynamically load new DLL servers into an existing surrogate and free the surrogate when it is no longer needed.

When to implement

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

When to use

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


The ISurrogate interface inherits from the IUnknown interface. ISurrogate also has these types of members:


The ISurrogate interface has these methods.


Unloads a DLL server.


Loads a DLL server into the implementing surrogate.



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, like Microsoft Visual Studio, 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.


Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]






IID_ISurrogate is defined as 00000022-0000-0000-C000-000000000046

See also

DLL Surrogates
Writing a Custom Surrogate



Community Additions

© 2015 Microsoft