Click here to Skip to main content
15,909,445 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOpenGL and CView problem Pin
FayezElFar23-Mar-05 11:50
FayezElFar23-Mar-05 11:50 
GeneralRe: OpenGL and CView problem Pin
Alexander M.,23-Mar-05 12:19
Alexander M.,23-Mar-05 12:19 
GeneralRe: OpenGL and CView problem Pin
FayezElFar24-Mar-05 4:25
FayezElFar24-Mar-05 4:25 
GeneralSimple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:01
sacoskun23-Mar-05 10:01 
GeneralRe: Simple error, but how to solve?:( Pin
PJ Arends23-Mar-05 10:09
professionalPJ Arends23-Mar-05 10:09 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:21
sacoskun23-Mar-05 10:21 
GeneralRe: Simple error, but how to solve?:( Pin
Barry Etter23-Mar-05 10:39
Barry Etter23-Mar-05 10:39 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:43
sacoskun23-Mar-05 10:43 
GeneralRe: Simple error, but how to solve?:( Pin
Barry Etter23-Mar-05 10:53
Barry Etter23-Mar-05 10:53 
GeneralRe: Simple error, but how to solve?:( Pin
PJ Arends23-Mar-05 10:55
professionalPJ Arends23-Mar-05 10:55 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 11:15
sacoskun23-Mar-05 11:15 
GeneralRe: Simple error, but how to solve?:( Pin
Serge Krynine23-Mar-05 11:54
Serge Krynine23-Mar-05 11:54 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 18:13
sacoskun23-Mar-05 18:13 
GeneralNeed some direction Pin
Tom Wright23-Mar-05 9:55
Tom Wright23-Mar-05 9:55 
GeneralRe: Need some direction Pin
PJ Arends23-Mar-05 10:59
professionalPJ Arends23-Mar-05 10:59 
GeneralRe: Need some direction Pin
Tom Wright23-Mar-05 11:21
Tom Wright23-Mar-05 11:21 
Questionneed a tool (or api) that creates login attempts to an active directory domain?? Pin
vista2723-Mar-05 9:25
vista2723-Mar-05 9:25 
AnswerRe: need a tool (or api) that creates login attempts to an active directory domain?? Pin
Blake Miller23-Mar-05 11:43
Blake Miller23-Mar-05 11:43 
QuestionHow to detect Network Cable Unplug Events Pin
Paolo Ponzano23-Mar-05 8:36
Paolo Ponzano23-Mar-05 8:36 
AnswerRe: How to detect Network Cable Unplug Events Pin
David Crow23-Mar-05 9:45
David Crow23-Mar-05 9:45 
GeneralHardware list error Pin
brilliant10123-Mar-05 8:10
brilliant10123-Mar-05 8:10 
GeneralRe: Hardware list error Pin
David Crow23-Mar-05 9:47
David Crow23-Mar-05 9:47 
GeneralSocket programming Pin
vinsankar23-Mar-05 6:55
vinsankar23-Mar-05 6:55 
GeneralRe: Socket programming Pin
greba23-Mar-05 7:44
greba23-Mar-05 7:44 
The problem with your code is that sizeof(struct message) is going to return the same number no matter what the size of the string. That is because the CString class has a pointer to a buffer which contains the actual string. You have just stumbled upon a problem that occurs very often. There are many ways around this, but the simpliest one I can think of would be to change your struct to:
<br />
struct message<br />
{<br />
  char name[256];<br />
};<br />


sizeof(struct message) would then return 256. This method is inefficient, as the whole buffer would be transferred, and it would be tougher to work with the char arrays instead of the CString's.



Greba,

My lack of content on my home page should be entertaining.
GeneralRe: Socket programming Pin
vinsankar23-Mar-05 21:44
vinsankar23-Mar-05 21:44 

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.