Wednesday, November 19, 2008

COM methods called across a network


If you have access to a machine on the network, and if a COM server for the object you want to use has been installed on that machine, then you can create the COM object on that computer. Of course, you must the proper privileges, and everything has to be set-up correctly on theother computer.

Since your COM object will not necessarily be on the local machine, you need a good way to "point to" it, even though its memory is somewhere else. Technically, there is no way to do this. In practice, it can be simulated by introducing a whole new level of objects. One of theways COM does this is with a concept called a proxy/stub. We'll discuss proxy/stubs in some detail later.Another important issue is passing data between the COM client and it's COM server. When data is passed between processes, threads, or over a network, it is called "Marshalling". Again, the proxy/stub takes care of the marshalling for you. COM can also marshal data for certain typesof interface using Type Libraries and the Automation marshaller. The Automation marshaller does not need to be specifically built for each COM

server.

0 comments: