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

C / C++ / MFC

 
GeneralRe: internet explorer plugin Pin
David Crow12-Sep-03 4:23
David Crow12-Sep-03 4:23 
QuestionMembership in Thread is defined by object or by method ? Pin
vgrigor12-Sep-03 3:14
vgrigor12-Sep-03 3:14 
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 
Something tells me that this is not just a "chat" program since you want to "send and receive variables".
What kind of a problem are you trying to build a solution for?
(Looks like asking: "I've bought a boat. How can I make it fly?" instead of asking "I want to go to the moon. How can I get there?" Wink | ;) )

pillepop wrote:
1.How can I now send and receive different variables...and distinguish them?
I just dont know how to use some kind of flag.

2.Also I would like to know how to get the Length of other objects...e.g. if i want to send a whole struct or Instance of another class.


This looks like you want to transfer binary data (all kinds of variables) over a TCP/IP connection. Take a look at MSDN samples CHATSRVR and CHATTER. The messages sent could easily be altered to send binary data instead. The CMsg object sent over the TCP/IP connection contains a few variables. If you send similar objects looking like this:
class CMsg : public CObject
{
protected:
DECLARE_DYNCREATE(CMsg)

public:
CMsg();
virtual ~CMsg();
virtual void Serialize(CArchive& ar);

DWORD m_dwCommand; //Tells the receiver how to interpret the data
DWORD m_dwLength;  //The length of the binary data section
BYTE* m_pBinaryData; //Command specific data (variable values)
BOOL m_bClose;
};
you could send just about anything across the connection, including structures as long as the receiver knows how to interpret the data by reading the m_dwCommand value.

If this is not what you are after: forget the whole thing above! Laugh | :laugh:
If this is your problem I hope this helped or maybe you should have a look at DCOM where you create a component on a different machine and communicate with it through an interface via RPC (TCP/IP).
But that's a different ball game!
If you are interested in DCOM there are very useful articles here at CodeProject.

--
Rog
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 
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 

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.