Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: simplest thread program doesn't work Pin
LighthouseJ7-Sep-05 13:58
LighthouseJ7-Sep-05 13:58 
Questionopening file by double-clicking (FileDDE) broken in VS 7.1 ?! Pin
T.T.H.6-Sep-05 22:36
T.T.H.6-Sep-05 22:36 
Questionstringsend? Pin
Member 21610046-Sep-05 22:31
Member 21610046-Sep-05 22:31 
AnswerRe: stringsend? Pin
Cedric Moonen6-Sep-05 23:13
Cedric Moonen6-Sep-05 23:13 
GeneralRe: stringsend? Pin
Member 21610046-Sep-05 23:39
Member 21610046-Sep-05 23:39 
GeneralRe: stringsend? Pin
Cedric Moonen6-Sep-05 23:45
Cedric Moonen6-Sep-05 23:45 
GeneralRe: stringsend? Pin
Member 21610047-Sep-05 17:20
Member 21610047-Sep-05 17:20 
AnswerRe: stringsend? Pin
kakan7-Sep-05 0:14
professionalkakan7-Sep-05 0:14 
It's possible that you have a problem with this line:
bytesSent = send( m_socket, sendbuf, lstrlen(sendbuf), 0 );

Since you use the length of sendbuf, you won't transmit the terminating NULL-byte of sendbuf.
This could present a problem in the receiving end.
If you wan't the original data (a char array) in you have got two options:
1.
Send the terminating NULL-character by doing this:
bytesSent = send( m_socket, sendbuf, lstrlen(sendbuf) + 1, 0 );

2.
At the receiving end, add a '\0' in the receive buffer at offset <noofreceivedbytes>. For instance:

bytesRecv = recv( m_socket, recvbuf, 300, 0 );
recvbuf[bytesRecv] = '\0';

Else, the code looks fine to me.
QuestionAdding page number to word doc Pin
Barm6-Sep-05 21:46
Barm6-Sep-05 21:46 
QuestionChange Font of caption of dialog box ?? Pin
ana_v1236-Sep-05 20:59
ana_v1236-Sep-05 20:59 
AnswerRe: Change Font of caption of dialog box ?? Pin
Barm6-Sep-05 21:43
Barm6-Sep-05 21:43 
GeneralRe: Change Font of caption (title) of dialog box ?? Pin
Anonymous13-Sep-05 1:47
Anonymous13-Sep-05 1:47 
QuestionProper time to record Pin
LiYS6-Sep-05 20:20
LiYS6-Sep-05 20:20 
AnswerRe: Proper time to record Pin
David Crow7-Sep-05 3:22
David Crow7-Sep-05 3:22 
QuestionProblem related to CImageList(explanation) Pin
a_david1236-Sep-05 20:18
a_david1236-Sep-05 20:18 
QuestionHow does CListCtrl notify its parent window when a cell content has changed? Pin
followait6-Sep-05 20:18
followait6-Sep-05 20:18 
AnswerRe: How does CListCtrl notify its parent window when a cell content has changed? Pin
Ian Bowler7-Sep-05 13:39
Ian Bowler7-Sep-05 13:39 
GeneralRe: How does CListCtrl notify its parent window when a cell content has changed? Pin
followait7-Sep-05 16:15
followait7-Sep-05 16:15 
AnswerRe: How does CListCtrl notify its parent window when a cell content has changed? Pin
David Crow8-Sep-05 2:34
David Crow8-Sep-05 2:34 
QuestionSEARCH PATTERN Pin
russel.ak6-Sep-05 19:58
russel.ak6-Sep-05 19:58 
AnswerRe: SEARCH PATTERN Pin
kakan6-Sep-05 21:25
professionalkakan6-Sep-05 21:25 
QuestionCross app SendMessage Pin
ayon1116-Sep-05 19:56
ayon1116-Sep-05 19:56 
QuestionHow to make a combobox to be flat? Pin
followait6-Sep-05 19:29
followait6-Sep-05 19:29 
AnswerRe: How to make a combobox to be flat? Pin
David Crow7-Sep-05 3:31
David Crow7-Sep-05 3:31 
Generalyes Pin
followait7-Sep-05 16:06
followait7-Sep-05 16:06 

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.