Visual Basic Concepts

In-Process and Out-of-Process Components

An application or component that uses objects provided by another component is called a client.

Components are characterized by their location relative to clients. An out-of-process component is an .exe file that runs in its own process, with its own thread of execution. Communication between a client and an out-of-process component is therefore called cross-process or out-of-process communication.

An in-process component, such as a .dll or .ocx file, runs in the same process as the client. It provides the fastest way of accessing objects, because property and method calls don’t have to be marshaled across process boundaries. However, an in-process component must use the client’s thread of execution.

For More Information   "Building Code Components" discusses in-process and out-of-process components in depth, including thread-safe DLLs and multithreaded EXE components. Control components (.ocx files) are always in-process, as discussed in depth in "Building ActiveX Controls." Components that provide active documents can run in process or out of process, as discussed in "Building ActiveX Documents."