SUMMARY ======= Although there may be several ways to implement communication between two executables, this sample illustrates a simple way a server and a client application can communicate using IDispatch interfaces. This may not be the best method, but it is straight forward to implement. You should consider using dual interfaces as the better solution. The sample consists of two executables. One (GENERAT.EXE) is a local server, and the other (GENCLNT.EXE) is a client of the server. Both client and server are automation servers in that they both support automation interfaces. The client application starts the server via CreateDispatch and thus obtains the servers IDispatch interface. The client then passes it's IDispatch interface to the server using one of the servers interface methods. At this point, two way communication between the client and the server is possible. Be sure to run the server stand-alone once before running it from the client. This will register the server and enable client to start it dynamically. MORE INFORMATION ================ The GENERAT.EXE local server generates and displays random colors. It can either generate one color each time as it is requested, or it can continuously generate colors in response to a WM_TIMER message. The GENERAT.EXE server can run either stand alone or it can be controlled by a client (in this case the GENCLNT.EXE application). In either case, the server will be visible and the server's user interface will be active. This means the client and the server will need to communicate with each other to keep the user interface of the client and server synchronized and to process requests from the other. Below is a list of relavent methods from GENERAT.EXE and GENCLNT.EXE and a description of each method. GENERAT.EXE methods: BOOL SetAdviseDI(LPDISPATCH DispIToAdvise); The client starts the server via CreateDispatch thus obtains the IDispatch pointer of the server. Once the client has the server's IDispatch pointer, it can call this method in the server sending it's own IDispatch pointer. At this point, Two way communication is possible between the client and the server. void ReleaseAdviseDI(); The client will call this method to tell the server to release the IDispatch pointer of the client. BOOL AnimateColors(); Called by the client to request that the server generate colors in response to WM_TIMER messages. void GenNewColor(); Called by the client to request that the server generate a single new color. GENCLNT.EXE methods: void SetAnimateUI(); Called by the server when Animate Colors is chosen via the server UI. This keeps the Animate Colors menu choice of the client synchronized with that of the server. void NotifyColorChange(const VARIANT FAR& refColor); Called by the server when a color is generated. Called regardless of whether the color was requested by the client or the server.