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. Using
dual interfaces may provide a better solution, however.
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 its IDispatch interface to the
server using one of the server's 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 the client to start it dynamically.
The following
files are available for download from the Microsoft Download
Center:
Visual C++ 6.0
For
additional information about how to download Microsoft Support files, click the
following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most
current virus-detection software that was available on the date that the file
was posted. The file is stored on security-enhanced servers that help to
prevent any unauthorized changes to the file.
Visual C++ .NET
The following
file is available for download from the Microsoft Download
Center:
Release Date: June 24, 2002
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
NOTE: Use the -d option when running Dispcom.exe to decompress the
file and recreate the proper directory structure.