Building a .Net Remoting Framework...?

Hey everyone, I am not the most proficient in developing in C++. I typically write in Visual Basic. However I need to write a program in C++. Specifically I need to build a remoting framework. Which I have done in Visual Basic before. However that was some time ago and I could use some help implementing it in C++.

I need to send data back and fourth in between two different application domains. So as the user events are activated in either application, the data in both applications are updated in real time. I thought using a TCP socket (.Net Remoting) would be the way to go.

I found a tutorial online, but I'm not totally clear on how it works so far. Here is the link:

http://www.winsocketdotnetworkprogramming.com/clientservernetremotingnetwork12c.html

From what I can tell the server program needs to be built with an app.Config file that defines the protocol and port number used to send and receive data. In this case it also looks like the app.Config file references the class that is going to marshal the data in the tag below. Does this sound accurate, is that what is going on?

<activated type="DemoCP.DemoClass, DemoCP" />

When writing and building the client application, it looks like in the following line of code: (from ClientCP example in the link)

DemoClass^ MyDemo = gcnew DemoClass();

The .Net remoting object is instantiated using gcnew. Is this how you access and send data to the server from the client source code, through the MyDemo object?

These are all assumptions on my part as I try to understand how remoting works in C++. I don't write in C++ very often, and usually when I need too there is a learning curve ahead.

Also, why does the Client and Server programs need to have an app.Config file to define the protocol and port number? Can't these things be defined in the source code itself?

Thank you for your time.
Also, why does the Client and Server programs need to have an app.Config file to define the protocol and port number? Can't these things be defined in the source code itself?


In general it is better to store the configuration in a seperate so that when you want to make a change you don't have to recompile everything. To change the config file a text editor is enough.

In this particular example it is necessary because the tutorial uses the RemotingConfiguration class to read the config.
Well I guess that makes sense then. More efficient than having to constantly rebuild everything.

What about this code here that I mentioned in my OP:

DemoClass^ MyDemo = gcnew DemoClass();


Is the MyDemo object a the way to send data to the server? I think gcnew is used to instantiate a .Net object, which makes me think that is what MyDemo is doing. Is this correct?

Is the MyDemo object a the way to send data to the server?

Yes it is. gcnew means that the object lives on the managed heap and is garbage collected.
Topic archived. No new replies allowed.