This is a simple sample Automation server and client. This sample implements a custom interface using the Automation marshaller. The Automation marshaller is not described much in the Microsoft documentation and articles but can be very useful. The only documentation I am aware of are:
The VTBLBIND sample server and client are very useful and the only significant advantage that my samples have is that my samples do less and therefore are simpler, but the VTBLBIND samples are more useful for a final product.
The following is the source code.
|
The easiest way to save these files as source/text files (using Internet Explorer) is to either:
|
Since this server has a type library, it can be called by Visual Basic. Add a reference to the ISendMessage.tlb file that is generated from the ISendMessage.idl file when the server project is built. Then the following code will call the server, but the server must be executing for it to work and each time the server is used in this manner requires a new execution of the server.
Dim Message As New CSendMessage Message.Send "Message"
See my Visual C++ Programmer Stuff page for more C++ stuff.