Remote function


I have two computers networked together; one has  C++ socket server app and is listening on port 5900 (or whichever)

The other computer has a C++ socket client app and establishes a connection to the server through port 5900.

My question is, using C++ (no MFC)  how am I able to call a MessageBox function from the client so that it is executed on the server?

Thanks for your time
Who is Participating?
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.

Jaime OlivaresSoftware ArchitectCommented:
Just have to establish your own protocol at client and server, define some "command" (either a word or a value) that client can send to the server, once the server recognize that command, it must open a message box and show the message sent trough the socket connection.
PastorDwayneAuthor Commented:
Thanks for your response;

could you give me a short code example as to how to do this on the client and server?

Thanks again.
Jaime OlivaresSoftware ArchitectCommented:
I don't know about your complete project, but if you have an already connected socket link, then you have to send some message from client using the send() function, you can send a string like:

MSGBOX:This is a test message

Then on your listen/receive function at server, you have to wait for a similar command string to arrive.

// Wait for receiving function, put it into buffer (char [] type)

if (!strcmp(buffer,"MSGBOX:")) {
    MessageBox(NULL, buffer+7, "Message from client", MB_OK);

Have a look to this tutorial article:

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

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.