How about my second question. I know that after reading the initial 4 bytes of the stream, stream points to the next byte start position. Since the length of the rest vary how can I read as u said. It's string, just a name like "ball, house, etc...."
Yep, initially I thought about this. But failed to do it. Because my destination is a string, that is my requirement. But my destination is in a buffer, a byte stream. I want to read it after finding the int value.
It is better to provide more details. InMsg is in BYTE* to a byte steam. GetDataLength() and GetDataBuffer() are two member functions to get the message and the length. Here in this case my message is included both int value and the string.
2) is the string of a constant length ?
No, string is not in fixed length. Actually contain some small words.
3) can you know its length by any method ?
Yes, string length is less than 4 bytes. (InMsg.GetDataLength()-4)
I know that after reading the initial 4 bytes of the stream, stream points to the next byte start position.
memcpy() does not move any pointers around, other than the ones it uses internally. After it finishes, InMsg is in the same state as before.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Ive gone quite crazy at microsoft for the weirdness of the CListCtrl, I just want to find out the contents of the selection in my list.. I can only find this: short Selected = m_MyList.GetSelectionMark();
But that returns the number of the item, if i fill my list with "Linux" and "Windows" then i would like a method which returns "Windows", or "Linux"... Are there any functions for that??