.Net Remoting - Post Message to Server/Host with parameters

What I need to be able to do is pass in 2 parameters (Int, IntPtr) from a client application to the host application.

I already have code that gets data from the host when the client loads using the below code on the host but I need to extend it for this scenario...

//This registers a channel for Cam Applications to listen on
TcpChannel tcpChannel = new TcpChannel(6400); 

ChannelServices.RegisterChannel(tcpChannel, false);
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;

//This Registers the URI (Method) for the client to call to get AppData
RemotingServices.Marshal(AppData, "GetAppData"); 

//I now want to allow the client to pass in some information to the host. How do I do this?

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CAMSYSTEMSAuthor Commented:
Any ideas?
CAMSYSTEMSAuthor Commented:
Managed to fix it - I was looking from the wrong angle....

All I needed to do is return a class from the server and call a method on that class...
Type requiredType = typeof(IApplicationCommunicator);
                object o = Activator.GetObject(requiredType, "tcp://" + host + ":6400/GetAppCommunicator");
                if (o is IApplicationCommunicator)
                    appCommunicator = (IApplicationCommunicator)o;
                    appCommunicator.SendApplicationHandle(mainWindowHandle, Process.GetCurrentProcess().Id);

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.