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

C / C++ / MFC

 
AnswerRe: Silent Crash On 2K - Debug Suggestions? Pin
Christian Graus6-Sep-05 17:10
protectorChristian Graus6-Sep-05 17:10 
GeneralRe: Silent Crash On 2K - Debug Suggestions? Pin
Paul Belikian6-Sep-05 18:58
Paul Belikian6-Sep-05 18:58 
GeneralRe: Silent Crash On 2K - Debug Suggestions? Pin
Christian Graus6-Sep-05 19:15
protectorChristian Graus6-Sep-05 19:15 
AnswerRe: Silent Crash On 2K - Debug Suggestions? Pin
Blake Miller7-Sep-05 9:49
Blake Miller7-Sep-05 9:49 
QuestionDisplay Unicode string in Win32 Console Pin
Le Tuan Anh6-Sep-05 16:49
Le Tuan Anh6-Sep-05 16:49 
Questionhow read another process of variable? Pin
00000000096-Sep-05 15:36
00000000096-Sep-05 15:36 
QuestionSend message Pin
Member 21610046-Sep-05 15:34
Member 21610046-Sep-05 15:34 
AnswerRe: Send message Pin
Christian Graus6-Sep-05 15:51
protectorChristian Graus6-Sep-05 15:51 
I'm at a loss why you keep pasting all of this code here. I'd also reiterate that it's obvious that you're using code when you have no idea what it does. Copy and paste without examining the code is no way to learn.


TTjen wrote:
char sendbuf[300] = "Client: Sending data.";
char recvbuf[300] = "";

bytesSent = send( m_socket, sendbuf, lstrlen(sendbuf), 0 );


As I said yesterday, it doesn't matter how big or small you make sendbuf, lstrlen will return the length of the string you assigned to it, which is 21. The rest of the variable just never gets sent, because it's beyond the null value which causes lstrlen to ( correctly ) stop counting. You can set this string to be any value you like, up to 300 characters, and it will send it and give you back it's length. A better approach would be to use a string class like std::string or, if you're using MFC, CString. Both give you access to the underlying char * without having to allocate any memory, or impose a length limit. then you can assign the text you type to this variable, and pass the buffer in to the send method.


Christian Graus - Microsoft MVP - C++
Questionusing GDI+ in C++ windows project Pin
mpastchenko6-Sep-05 13:51
mpastchenko6-Sep-05 13:51 
AnswerRe: using GDI+ in C++ windows project Pin
Christian Graus6-Sep-05 14:55
protectorChristian Graus6-Sep-05 14:55 
GeneralRe: using GDI+ in C++ windows project Pin
mpastchenko7-Sep-05 8:33
mpastchenko7-Sep-05 8:33 
GeneralRe: using GDI+ in C++ windows project Pin
mpastchenko7-Sep-05 9:10
mpastchenko7-Sep-05 9:10 
GeneralRe: using GDI+ in C++ windows project Pin
Christian Graus7-Sep-05 12:45
protectorChristian Graus7-Sep-05 12:45 
GeneralRe: using GDI+ in C++ windows project Pin
Christian Graus7-Sep-05 12:43
protectorChristian Graus7-Sep-05 12:43 
GeneralRe: using GDI+ in C++ windows project Pin
mpastchenko7-Sep-05 14:31
mpastchenko7-Sep-05 14:31 
GeneralRe: using GDI+ in C++ windows project Pin
Christian Graus7-Sep-05 14:34
protectorChristian Graus7-Sep-05 14:34 
GeneralRe: using GDI+ in C++ windows project Pin
mpastchenko7-Sep-05 15:39
mpastchenko7-Sep-05 15:39 
QuestionError in Release Build Only Pin
hamza56-Sep-05 13:48
hamza56-Sep-05 13:48 
AnswerRe: Error in Release Build Only Pin
ThatsAlok6-Sep-05 18:56
ThatsAlok6-Sep-05 18:56 
GeneralRe: Error in Release Build Only Pin
Anonymous7-Sep-05 6:57
Anonymous7-Sep-05 6:57 
AnswerRe: Error in Release Build Only Pin
Anonymous6-Sep-05 20:59
Anonymous6-Sep-05 20:59 
GeneralRe: Error in Release Build Only Pin
Anonymous7-Sep-05 6:58
Anonymous7-Sep-05 6:58 
QuestionTrouble with writing dll Pin
Christian Graus6-Sep-05 13:03
protectorChristian Graus6-Sep-05 13:03 
AnswerRe: Trouble with writing dll Pin
S Douglas6-Sep-05 23:20
professionalS Douglas6-Sep-05 23:20 
GeneralRe: Trouble with writing dll Pin
Christian Graus7-Sep-05 12:31
protectorChristian Graus7-Sep-05 12:31 

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.