In the following cases leads to the usage of the Stub and Proxy:
1. Call COM Interfaces living in other Apartments.
2. Call COM Interfaces living in an EXE Server.
Definition for Stub and Proxy:
- Proxy : A COM object loaded into the client's process, which packages up client requests for any out-of-process ( or out of apartment ) method invocation.
- Stub : A COM object loaded into the server's process, which receives the client's requests, unpackages them, and handles them off to the "real COM object."
Under the hoold, a procedure named "Marshaling" works between process, which includes the process of packing, sending, receiving and unpacking data between clients and servers, via Stubs and Proxies.