Click here to Skip to main content
15,888,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Reverse Find Index Coblist Pin
basementman6-Jan-05 4:27
basementman6-Jan-05 4:27 
GeneralDLL header hiding question... Pin
JulesChrono5-Jan-05 11:08
JulesChrono5-Jan-05 11:08 
GeneralRe: DLL header hiding question... Pin
DaneStorm5-Jan-05 18:33
DaneStorm5-Jan-05 18:33 
GeneralRe: DLL header hiding question... Pin
lzzqqq5-Jan-05 20:11
lzzqqq5-Jan-05 20:11 
GeneralEmbedded dialog hoards messages (MFC) Pin
Alex McMorris5-Jan-05 10:53
Alex McMorris5-Jan-05 10:53 
GeneralWindows Socket DLL Pin
RedDragon2k5-Jan-05 9:59
RedDragon2k5-Jan-05 9:59 
GeneralDocument Pin
act_x5-Jan-05 9:43
act_x5-Jan-05 9:43 
GeneralSending string (text or array of character) trough a socket-connection. Pin
SimCom5-Jan-05 9:22
SimCom5-Jan-05 9:22 
Hello my best friends,

I'm a beginner to Visual C++ programming, so I have some "stupid" questions for you and I hope you guys to help me.

I'm working on my own very simple chatapplication, but I encounterd some problems. I've made a client and a server part, I've tested it out but I had the problem that I couldn't send a text string. My serverside establishes a connection with the clientside ( I know it because I put some control messages to be sure there is a connection).

But when I try to send a peace of text, it does nothing except that it shows the sending text on my display and the receiver part shows nothing on the display. I used the following code to send a string:

void CSimComDlg::OnSend()
{
m_Message.GetWindowText(strMESSAGE);
m_pArOut->WriteString(strMESSAGE);
m_pArOut->Flush();
m_MsgDsp.SetWindowText(_T(Name+":"+strMESSAGE+"\r\n"));
strMESSAGE.Empty();
}

And to read a received string:

void CSimComDlg::ReadReceive()
{
m_pArIn->ReadString(strMESSAGE);
m_MsgDsp.SetWindowText(_T("Chatter:"+strMESSAGE+"\r\n"));
strMESSAGE.Empty();
}

m_pArOut and m_pArIn are CArchive pointers (I use this in combination with CSocketFile to send data over internet).

Is there something wrong with these codes?

I've seen some other example codes on the internet, they include also the length of the message to send and they check also the buffer if there's more data coming in. But are they neccesary to put them in my code?

I hope you can help me boyzz

If my application works, I forget all my problems.


If my application works, I forget all my problems.
GeneralRe: Sending string (text or array of character) trough a socket-connection. Pin
Ravi Bhavnani5-Jan-05 10:13
professionalRavi Bhavnani5-Jan-05 10:13 
GeneralRe: Sending string (text or array of character) trough a socket-connection. Pin
SimCom5-Jan-05 23:55
SimCom5-Jan-05 23:55 
GeneralClass Confusion Pin
whitee5-Jan-05 7:57
whitee5-Jan-05 7:57 
GeneralRe: Class Confusion Pin
Gerald Schwab5-Jan-05 8:49
Gerald Schwab5-Jan-05 8:49 
GeneralDrawing rectangles, lines and arcs in directx Pin
SteQve5-Jan-05 7:51
SteQve5-Jan-05 7:51 
GeneralOpenGL question : wglUseFontBitmaps and glGenLists Pin
Maximilien5-Jan-05 4:55
Maximilien5-Jan-05 4:55 
GeneralRe: OpenGL question : wglUseFontBitmaps and glGenLists Pin
El Corazon5-Jan-05 7:03
El Corazon5-Jan-05 7:03 
GeneralRe: OpenGL question : wglUseFontBitmaps and glGenLists Pin
Maximilien5-Jan-05 7:21
Maximilien5-Jan-05 7:21 
GeneralFrom C to C++ Pointer Pin
jw815-Jan-05 4:55
jw815-Jan-05 4:55 
GeneralRe: From C to C++ Pointer Pin
David Crow5-Jan-05 5:24
David Crow5-Jan-05 5:24 
GeneralRe: From C to C++ Pointer Pin
jw815-Jan-05 5:26
jw815-Jan-05 5:26 
GeneralRe: From C to C++ Pointer Pin
David Crow5-Jan-05 5:54
David Crow5-Jan-05 5:54 
GeneralRe: From C to C++ Pointer Pin
jw815-Jan-05 15:38
jw815-Jan-05 15:38 
GeneralRe: From C to C++ Pointer Pin
Maximilien5-Jan-05 16:14
Maximilien5-Jan-05 16:14 
GeneralRe: From C to C++ Pointer Pin
jw815-Jan-05 17:16
jw815-Jan-05 17:16 
GeneralRe: From C to C++ Pointer Pin
ThatsAlok5-Jan-05 22:05
ThatsAlok5-Jan-05 22:05 
GeneralRe: From C to C++ Pointer Pin
Maximilien5-Jan-05 5:43
Maximilien5-Jan-05 5:43 

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.