Click here to Skip to main content
15,908,264 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Read a byte stream into separate buffers. [modified] Pin
toxcct5-Dec-07 23:05
toxcct5-Dec-07 23:05 
GeneralRe: Read a byte stream into separate buffers. Pin
CodingLover5-Dec-07 23:15
CodingLover5-Dec-07 23:15 
GeneralRe: Read a byte stream into separate buffers. Pin
toxcct5-Dec-07 23:19
toxcct5-Dec-07 23:19 
GeneralRe: Read a byte stream into separate buffers. Pin
CodingLover5-Dec-07 23:48
CodingLover5-Dec-07 23:48 
GeneralRe: Read a byte stream into separate buffers. Pin
toxcct5-Dec-07 23:54
toxcct5-Dec-07 23:54 
GeneralRe: Read a byte stream into separate buffers. Pin
CodingLover6-Dec-07 0:00
CodingLover6-Dec-07 0:00 
GeneralRe: Read a byte stream into separate buffers. Pin
toxcct6-Dec-07 0:07
toxcct6-Dec-07 0:07 
GeneralRe: Read a byte stream into separate buffers. Pin
CodingLover6-Dec-07 0:28
CodingLover6-Dec-07 0:28 
toxcct wrote:
1) so, to begin, what have you tried so far to extract the string ?


Lots of things I've tried,

<br />
		char* varBuffer = new char[(InMsg.GetDataLength() - 4)];<br />
		string var_name(&InMsg[3], (InMsg.GetDataLength()-4));<br />


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.


toxcct wrote:
2) is the string of a constant length ?


No, string is not in fixed length. Actually contain some small words.


toxcct wrote:

3) can you know its length by any method ?


Yes, string length is less than 4 bytes. (InMsg.GetDataLength()-4)

I appreciate your help all the time...
Eranga Smile | :)

GeneralRe: Read a byte stream into separate buffers. [modified] Pin
toxcct6-Dec-07 1:55
toxcct6-Dec-07 1:55 
GeneralRe: Read a byte stream into separate buffers. Pin
CodingLover6-Dec-07 17:28
CodingLover6-Dec-07 17:28 
GeneralRe: Read a byte stream into separate buffers. Pin
jhwurmbach6-Dec-07 4:11
jhwurmbach6-Dec-07 4:11 
GeneralRe: Read a byte stream into separate buffers. Pin
CodingLover6-Dec-07 17:31
CodingLover6-Dec-07 17:31 
GeneralRe: Read a byte stream into separate buffers. Pin
CodingLover5-Dec-07 23:39
CodingLover5-Dec-07 23:39 
GeneralRe: Read a byte stream into separate buffers. Pin
CPallini5-Dec-07 23:44
mveCPallini5-Dec-07 23:44 
GeneralRe: Read a byte stream into separate buffers. Pin
CodingLover5-Dec-07 23:51
CodingLover5-Dec-07 23:51 
GeneralRe: Read a byte stream into separate buffers. Pin
David Crow6-Dec-07 2:56
David Crow6-Dec-07 2:56 
JokeOf course, on such systems you need a CRC... Pin
CPallini5-Dec-07 23:20
mveCPallini5-Dec-07 23:20 
GeneralRe: Of course, on such systems you need a CRC... Pin
toxcct5-Dec-07 23:24
toxcct5-Dec-07 23:24 
QuestionCListCtrl Get selection? Pin
Johpoke5-Dec-07 21:28
Johpoke5-Dec-07 21:28 
AnswerRe: CListCtrl Get selection? Pin
CPallini5-Dec-07 21:50
mveCPallini5-Dec-07 21:50 
GeneralRe: CListCtrl Get selection? Pin
Johpoke5-Dec-07 22:14
Johpoke5-Dec-07 22:14 
GeneralRe: CListCtrl Get selection? Pin
Nelek5-Dec-07 22:58
protectorNelek5-Dec-07 22:58 
AnswerRe: CListCtrl Get selection? Pin
David Crow6-Dec-07 3:01
David Crow6-Dec-07 3:01 
GeneralReceive LVN_BEGINDRAG in parent dialog of CListCtrl, but no LVN_ENDDRAG Pin
followait5-Dec-07 21:25
followait5-Dec-07 21:25 
Generalyyuuyuu Pin
vghh5-Dec-07 21:16
sussvghh5-Dec-07 21:16 

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.