Returning Objects to the Server

So far, we've seen situations where we get a remote reference to an object on the remote server and make calls on it. Now there might be times when you want to pass a local object to the remote server, so that the remote object can access the local object. We'll see such an example now, where we pass an object by reference to the server and the server objects manipulate this object.

The Remoted Objects

As usual we define our remotable objects in a library that both client and server can share. This time we have two objects: the object that is remoted by the server and the object that is passed from the client to the server. Let's look at the object that is passed by reference to the server:

 public __gc class MyClass ...

Get Extending MFC Applications with the .NET Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.