Click here to Skip to main content
15,917,062 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString assignment crashes on Windows 7 Pin
Stephen Hewitt5-Dec-12 3:49
Stephen Hewitt5-Dec-12 3:49 
AnswerRe: CString assignment crashes on Windows 7 Pin
pandit8418-Dec-12 7:48
pandit8418-Dec-12 7:48 
GeneralRe: CString assignment crashes on Windows 7 Pin
Stephen Hewitt18-Dec-12 17:44
Stephen Hewitt18-Dec-12 17:44 
QuestionSegmentation Fault in GTK library files Pin
SrivathsanRaghavan2-Dec-12 19:20
SrivathsanRaghavan2-Dec-12 19:20 
AnswerRe: Segmentation Fault in GTK library files Pin
Richard MacCutchan2-Dec-12 21:47
mveRichard MacCutchan2-Dec-12 21:47 
GeneralRe: Segmentation Fault in GTK library files Pin
SrivathsanRaghavan2-Dec-12 22:11
SrivathsanRaghavan2-Dec-12 22:11 
GeneralRe: Segmentation Fault in GTK library files Pin
Richard MacCutchan2-Dec-12 22:28
mveRichard MacCutchan2-Dec-12 22:28 
GeneralRe: Segmentation Fault in GTK library files Pin
SrivathsanRaghavan3-Dec-12 0:25
SrivathsanRaghavan3-Dec-12 0:25 
GeneralRe: Segmentation Fault in GTK library files Pin
Richard MacCutchan3-Dec-12 0:55
mveRichard MacCutchan3-Dec-12 0:55 
Questioncan i use mem_fun like this? Pin
Falconapollo1-Dec-12 17:37
Falconapollo1-Dec-12 17:37 
AnswerRe: can i use mem_fun like this? Pin
Richard MacCutchan1-Dec-12 20:56
mveRichard MacCutchan1-Dec-12 20:56 
AnswerRe: can i use mem_fun like this? Pin
Stephen Hewitt2-Dec-12 4:45
Stephen Hewitt2-Dec-12 4:45 
AnswerRe: can i use mem_fun like this? Pin
troyxyz2-Dec-12 6:21
troyxyz2-Dec-12 6:21 
AnswerRe: can i use mem_fun like this? Pin
Stefan_Lang3-Dec-12 2:14
Stefan_Lang3-Dec-12 2:14 
AnswerRe: can i use mem_fun like this? Pin
Stefan_Lang3-Dec-12 3:45
Stefan_Lang3-Dec-12 3:45 
GeneralRe: can i use mem_fun like this? Pin
Falconapollo4-Dec-12 14:43
Falconapollo4-Dec-12 14:43 
Questionclient server for running the program Pin
danielsutopo1-Dec-12 15:09
danielsutopo1-Dec-12 15:09 
AnswerRe: client server for running the program Pin
Albert Holguin1-Dec-12 17:22
professionalAlbert Holguin1-Dec-12 17:22 
First off... for something like this, I wouldn't use UDP, I would use TCP/IP. There's really no reason to use UDP, which sends datagrams with no built-in error checking, TCP/IP already handles the error checking/handling (i.e. it'll automatically retransmit packets that didn't arrive at their destination correctly). Usually you only want to use UDP when you have something that doesn't require reliability like voice or video (i.e. if you lose a packet here and there it won't really matter, you'll still be able to hear/see the other person).

As far as sending the data, if you're making for the server and client, it's easy, you define the data messages/structures that are being passed between both completely yourself (via what is typically referred to as an API). Usually the packets are made up of binary buffers, within that buffer, you can either have fixed length or variable length data buffers (or packets), the structure of which is completely up to you.

For example, you can specify:
0. first 4-bytes of the buffer define the message type
1. next 4-bytes define a message specification
2. next 4-bytes define the message size
3. so on...

In this scenario, when you receive a packet, first thing you'll do is cast it onto a data structure that is defined by your API. The first portion of the structure would be an int type (picked it because it's 4-bytes in a 32bit system) and it can specify the type of message that is contained in that data packet. The next portion can be a subset of that message and so on.

Search google and CodeProject for client/server examples and see how they defined their messages.
QuestionLimiting selected checkbox items in a CListCtrl Pin
softwaremonkey1-Dec-12 1:40
softwaremonkey1-Dec-12 1:40 
SuggestionRe: Limiting selected checkbox items in a CListCtrl Pin
David Crow1-Dec-12 3:51
David Crow1-Dec-12 3:51 
AnswerRe: Limiting selected checkbox items in a CListCtrl Pin
Jochen Arndt1-Dec-12 23:56
professionalJochen Arndt1-Dec-12 23:56 
GeneralRe: Limiting selected checkbox items in a CListCtrl Pin
softwaremonkey2-Dec-12 22:45
softwaremonkey2-Dec-12 22:45 
QuestionUsing VISUAL C++ 6.0 with OLE Pin
ForNow30-Nov-12 9:06
ForNow30-Nov-12 9:06 
AnswerRe: Using VISUAL C++ 6.0 with OLE Pin
jschell30-Nov-12 10:46
jschell30-Nov-12 10:46 
SuggestionRe: Using VISUAL C++ 6.0 with OLE Pin
David Crow30-Nov-12 14:24
David Crow30-Nov-12 14:24 

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.