Click here to Skip to main content
16,018,802 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Membership in Thread is defined by object or by method ? Pin
Mike Dimmick12-Sep-03 5:26
Mike Dimmick12-Sep-03 5:26 
QuestionHow to use the Word Object Library in VC++? Pin
GTS202012-Sep-03 2:52
GTS202012-Sep-03 2:52 
AnswerRe: How to use the Word Object Library in VC++? Pin
David Crow12-Sep-03 2:56
David Crow12-Sep-03 2:56 
GeneralRe: How to use the Word Object Library in VC++? Pin
GTS202012-Sep-03 3:21
GTS202012-Sep-03 3:21 
GeneralChat - Program Pin
pillepop12-Sep-03 2:37
pillepop12-Sep-03 2:37 
GeneralRe: Chat - Program Pin
Roger Stoltz12-Sep-03 3:59
Roger Stoltz12-Sep-03 3:59 
GeneralRe: Chat - Program Pin
pillepop12-Sep-03 5:39
pillepop12-Sep-03 5:39 
GeneralRe: Chat - Program Pin
Peter Weyzen12-Sep-03 10:26
Peter Weyzen12-Sep-03 10:26 
Here's a good hint from writing software. Always do your best to seperate your UI from your back-end.

Your issues of how to display stuff is one thing, but what you actually intend to do here is: post a interpretable message from one client to another. Most chat programs do this by either using a specific packet/message format -- or use some "RPC".

Ignore the RPC for now.

What I think you need to do, is define a message format. This message format is something used by one client to convey one of many possible messages to another client.

The message that you want to send needs to be able to contain:
* identification of what type of message you are sending
* its good to include the size of the whole message
* and the "message" itself.

I should say, that my use of the word "message" should not be confused with a "chat message". This is a broader term for any bit of communication from one client to another.

In instant messaging, these messages are commonly:
* "instant message"
* "i want to log in and here's my password"
* "i am logging off"
* "here's a file"
* "i am away"

stuff like that.

You might consider XML as a nice and easily interpretable way to send messages.

But more often than not, the "message" is sent a data block.

Here's a possible message format -- this is a "message header";
[Message-Type: stored as a DWORD]
[Message-Length: stored as a DWORD]

With this information, you can now interpret the packet/message to determine what the caller wants to tell you. Message-Type of (3) might mean that you are "away". and a (6) might mean "i want to transfer a file".

Depending on the message ID, the data that follows will be in the format appropriate to that message type....

I'll leave you with this -- but I hope these clues help.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>

GeneralMenu in MFC Pin
cberam12-Sep-03 1:53
cberam12-Sep-03 1:53 
GeneralRe: Menu in MFC Pin
vcplusplus12-Sep-03 2:42
vcplusplus12-Sep-03 2:42 
GeneralRe: Menu in MFC Pin
Mike O'Neill12-Sep-03 15:59
Mike O'Neill12-Sep-03 15:59 
GeneralCheck if file is executable Pin
peterchen12-Sep-03 1:43
peterchen12-Sep-03 1:43 
GeneralRe: Check if file is executable Pin
geo_m12-Sep-03 2:38
geo_m12-Sep-03 2:38 
GeneralRe: Check if file is executable Pin
vcplusplus12-Sep-03 2:48
vcplusplus12-Sep-03 2:48 
GeneralRe: Check if file is executable Pin
David Crow12-Sep-03 7:31
David Crow12-Sep-03 7:31 
GeneralRe: Check if file is executable Pin
David Crow12-Sep-03 7:33
David Crow12-Sep-03 7:33 
GeneralThreads and object Pin
El'Cachubrey12-Sep-03 1:07
El'Cachubrey12-Sep-03 1:07 
GeneralRe: Threads and object Pin
Dangleberry12-Sep-03 1:36
sussDangleberry12-Sep-03 1:36 
QuestionWhere can I find a table of all functions inside in kernel32.dll? Pin
Tommy Svensson12-Sep-03 0:34
Tommy Svensson12-Sep-03 0:34 
AnswerRe: Where can I find a table of all functions inside in kernel32.dll? Pin
El'Cachubrey12-Sep-03 0:53
El'Cachubrey12-Sep-03 0:53 
AnswerRe: Where can I find a table of all functions inside in kernel32.dll? Pin
Mike Dimmick12-Sep-03 2:15
Mike Dimmick12-Sep-03 2:15 
AnswerRe: Where can I find a table of all functions inside in kernel32.dll? Pin
David Crow12-Sep-03 2:52
David Crow12-Sep-03 2:52 
Generalhelp - mfc, and entering text Pin
lxxrya00112-Sep-03 0:14
lxxrya00112-Sep-03 0:14 
GeneralRe: help - mfc, and entering text Pin
valikac12-Sep-03 6:04
valikac12-Sep-03 6:04 
GeneralRe: help - mfc, and entering text like on paint Pin
lxxrya00112-Sep-03 11:13
lxxrya00112-Sep-03 11:13 

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.