Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Comunication between software Pin
earl11-Jul-06 4:01
earl11-Jul-06 4:01 
AnswerRe: Comunication between software Pin
ldaoust11-Jul-06 4:24
ldaoust11-Jul-06 4:24 
GeneralRe: Comunication between software Pin
NorGUI11-Jul-06 5:46
NorGUI11-Jul-06 5:46 
GeneralRe: Comunication between software Pin
earl11-Jul-06 5:52
earl11-Jul-06 5:52 
GeneralRe: Comunication between software Pin
ldaoust11-Jul-06 7:18
ldaoust11-Jul-06 7:18 
GeneralRe: Comunication between software Pin
earl11-Jul-06 7:26
earl11-Jul-06 7:26 
GeneralRe: Comunication between software Pin
NorGUI11-Jul-06 23:22
NorGUI11-Jul-06 23:22 
GeneralRe: Comunication between software [modified] Pin
ldaoust12-Jul-06 4:00
ldaoust12-Jul-06 4:00 
Salut AutreChien,

To communicate using TCP (TCP/IP is the same thing) you will be using sockets. You create a socket for TCP by specifying SOCK_STREAM as the familly (type). All the logic for transferring packets with this protocol is handled by the socket library so you dont need to worry about that. You then connect to a remote or local address (you probably will be using 'localhost' as the address for the local PC), then you send and receive data using the proper functions (send and recv) and giving a buffer with data to send (or buffer to receive data). It is traitforward at the base.

If you already used sockets then you already know how to do it. If not, you will need to read about sockets, there is a lot of info about that on the net and on this website.

An advice to you, do not use MFC sockets, the CSocket class, it is not very efficient. CAsyncSocket is acceptable since it does not have a lot of overhead built in it. Depending on your knowledge of sockets, you can go with basic socket object and create your own class or find a class here on CodeProject, just make sure it is not a class derived from CSocket.

If you are using Visual C++, look up the CAsyncSocket in the help (in MSDN) and you should find a sample called CHATSRVR (Chat server) it probaly will be a good starting point for what you want to do.

Here's a good reference[^] for Windows sockets.

Bonne chance et joyeuse programmation Smile | :)


Louis
* google is your friend *
AnswerRe: Comunication between software Pin
Joe Woodbury11-Jul-06 8:00
professionalJoe Woodbury11-Jul-06 8:00 
QuestionResize the Model Dialog Pin
Uday Janaswamy11-Jul-06 3:24
Uday Janaswamy11-Jul-06 3:24 
AnswerRe: Resize the Model Dialog Pin
ashish dogra11-Jul-06 3:27
ashish dogra11-Jul-06 3:27 
QuestionRe: Resize the Model Dialog Pin
David Crow11-Jul-06 5:04
David Crow11-Jul-06 5:04 
AnswerRe: Resize the Model Dialog Pin
_AnsHUMAN_ 11-Jul-06 3:46
_AnsHUMAN_ 11-Jul-06 3:46 
QuestionC/C++ interpreter Pin
ayshe11-Jul-06 2:30
ayshe11-Jul-06 2:30 
AnswerRe: C/C++ interpreter Pin
David Crow11-Jul-06 2:35
David Crow11-Jul-06 2:35 
AnswerRe: C/C++ interpreter Pin
toxcct11-Jul-06 2:35
toxcct11-Jul-06 2:35 
AnswerRe: C/C++ interpreter Pin
Maximilien11-Jul-06 2:37
Maximilien11-Jul-06 2:37 
GeneralRe: C/C++ interpreter Pin
toxcct11-Jul-06 2:59
toxcct11-Jul-06 2:59 
AnswerRe: C/C++ interpreter Pin
Hamid_RT11-Jul-06 3:20
Hamid_RT11-Jul-06 3:20 
AnswerRe: C/C++ interpreter Pin
Christian Graus11-Jul-06 4:15
protectorChristian Graus11-Jul-06 4:15 
GeneralRe: C/C++ interpreter Pin
Steve S11-Jul-06 6:00
Steve S11-Jul-06 6:00 
GeneralRe: C/C++ interpreter Pin
Christian Graus11-Jul-06 6:28
protectorChristian Graus11-Jul-06 6:28 
GeneralRe: C/C++ interpreter Pin
Steve S11-Jul-06 6:32
Steve S11-Jul-06 6:32 
GeneralRe: C/C++ interpreter Pin
Christian Graus11-Jul-06 7:06
protectorChristian Graus11-Jul-06 7:06 
Answerthanks... Pin
ayshe11-Jul-06 8:29
ayshe11-Jul-06 8:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.