Click here to Skip to main content
15,847,583 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: stack error in char array Pin
tolw31-May-11 0:00
tolw31-May-11 0:00 
GeneralRe: stack error in char array Pin
Stefan_Lang31-May-11 0:07
Stefan_Lang31-May-11 0:07 
GeneralRe: stack error in char array Pin
«_Superman_»31-May-11 5:03
professional«_Superman_»31-May-11 5:03 
GeneralRe: stack error in char array Pin
Chuck O'Toole31-May-11 7:48
Chuck O'Toole31-May-11 7:48 
GeneralRe: stack error in char array Pin
Stefan_Lang31-May-11 23:59
Stefan_Lang31-May-11 23:59 
GeneralRe: stack error in char array Pin
«_Superman_»1-Jun-11 0:01
professional«_Superman_»1-Jun-11 0:01 
AnswerRe: stack error in char array Pin
Stefan_Lang30-May-11 23:40
Stefan_Lang30-May-11 23:40 
AnswerRe: stack error in char array Pin
Chuck O'Toole31-May-11 2:54
Chuck O'Toole31-May-11 2:54 
I'm not that familiar with the ClientSocket class but I have a few observations / questions.
1) Clearly you expect "recMessage" to be a null terminated string (you "cout" it)

2) Who puts the NULL character at the end of each message?

3) Your buffer is "STRLEN" characters long (assuming you fix the declaration), you tell RecvData to read "STRLEN" characters. Who accounts for the NULL? Either the buffer needs to be one character bigger or the RecvData should be for one character smaller.

4) there is nothing to indicate the length of the received message in that API so how do you know or verified that all messages are < 200 characters as you stated in another reply.

5) the memset at the end of the routine does nothing useful. While it looks OK, are you sure that statement is not causing the problem.

6) other folks have commented on the declaration "char recMessage[STRLEN]" where STRLEN is not a #define constant but a variable. I suspect this is not what is used in the actual compiled code.
GeneralRe: stack error in char array Pin
Stefan_Lang1-Jun-11 0:03
Stefan_Lang1-Jun-11 0:03 
GeneralRe: stack error in char array Pin
MicroVirus1-Jun-11 3:15
MicroVirus1-Jun-11 3:15 
GeneralRe: stack error in char array Pin
Chuck O'Toole1-Jun-11 3:43
Chuck O'Toole1-Jun-11 3:43 
GeneralRe: stack error in char array Pin
Stefan_Lang1-Jun-11 4:15
Stefan_Lang1-Jun-11 4:15 
QuestionWhy my 64 architecture exe is not able to read registry? Pin
rahul.kulshreshtha30-May-11 3:51
rahul.kulshreshtha30-May-11 3:51 
AnswerRe: Why my 64 architecture exe is not able to read registry? Pin
MicroVirus30-May-11 4:29
MicroVirus30-May-11 4:29 
GeneralRe: Why my 64 architecture exe is not able to read registry? Pin
rahul.kulshreshtha30-May-11 4:34
rahul.kulshreshtha30-May-11 4:34 
GeneralRe: Why my 64 architecture exe is not able to read registry? Pin
MicroVirus30-May-11 4:46
MicroVirus30-May-11 4:46 
AnswerRe: Why my 64 architecture exe is not able to read registry? Pin
Rolf Kristensen30-May-11 7:17
Rolf Kristensen30-May-11 7:17 
QuestionProblem with Imagelist_LoadBitmap Pin
Cold_Fearing_Bird29-May-11 8:26
Cold_Fearing_Bird29-May-11 8:26 
AnswerRe: Problem with Imagelist_LoadBitmap Pin
Niklas L29-May-11 9:39
Niklas L29-May-11 9:39 
QuestionPassing char* to a function and change the argument problem Pin
.jpg29-May-11 7:24
.jpg29-May-11 7:24 
AnswerRe: Passing char* to a function and change the argument problem Pin
CPallini29-May-11 7:38
mveCPallini29-May-11 7:38 
AnswerRe: Passing char* to a function and change the argument problem Pin
Richard MacCutchan29-May-11 14:26
mveRichard MacCutchan29-May-11 14:26 
GeneralRe: Passing char* to a function and change the argument problem Pin
MicroVirus30-May-11 4:37
MicroVirus30-May-11 4:37 
GeneralRe: Passing char* to a function and change the argument problem Pin
Richard MacCutchan30-May-11 5:13
mveRichard MacCutchan30-May-11 5:13 
GeneralRe: Passing char* to a function and change the argument problem Pin
MicroVirus30-May-11 5:39
MicroVirus30-May-11 5:39 

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.