views:

34

answers:

1

Hi, Recently i designed an MFC paint application so can anyone provide me idea to how to share this application to others so that when i draw on this application others also can watch what i am drawing.

A: 

You could go with Winsock. But as Jonathan comments, this is a big undertaking. Do you have any preferences on how you want to share the drawing? Do you have any experience with networking? Will you have several clients who will be able to see what one draws? Should both be able to draw in the same painting?

You should note that with Winsock you need support for:

  • Data that you send can be combined into one message.
  • Data that you send can be split into two (or more) messages.
  • Data that you send can be buffered. That is, it may not be sent right away.

Note that this is not decided by you but probably by the underlying network. This is often solved by sending the size of the packages that you will transfer first, followed by the actual data.

struct Data {
    unsigned int sizeOfData;
    char* theData;
};
Default