Click here to Skip to main content
15,889,867 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error Message Pin
ashishbhatt1-Oct-07 19:30
ashishbhatt1-Oct-07 19:30 
GeneralRe: Error Message Pin
zakkas24831-Oct-07 19:35
zakkas24831-Oct-07 19:35 
GeneralRe: Error Message Pin
Stephen Hewitt1-Oct-07 19:37
Stephen Hewitt1-Oct-07 19:37 
QuestionRe: Error Message Pin
David Crow2-Oct-07 2:28
David Crow2-Oct-07 2:28 
AnswerRe: Error Message Pin
Cedric Moonen1-Oct-07 20:58
Cedric Moonen1-Oct-07 20:58 
QuestionHow to read bytes from winsock efficiently Pin
Ontanggabe Parulian1-Oct-07 17:20
Ontanggabe Parulian1-Oct-07 17:20 
AnswerRe: How to read bytes from winsock efficiently Pin
chandu0041-Oct-07 19:27
chandu0041-Oct-07 19:27 
QuestionRe: How to read bytes from winsock efficiently Pin
Ontanggabe Parulian1-Oct-07 19:41
Ontanggabe Parulian1-Oct-07 19:41 
This is snippet of my codes:

void CIsoMsg::mfc_voidGetByteRq(char *ld_pchrDst)<br />
{<br />
	int ld_intByteRqLen;<br />
	ld_intByteRqLen = this->md_strCompIsoMsg.length() >> 1;<br />
<br />
	char *ld_pchrByteRq = new char[ld_intByteRqLen];<br />
	for(int i=0; i < ld_intByteRqLen; ld_pchrByteRq[i++]=0);<br />
	this->mfc_voidHex2Byte((char*)this->md_strCompIsoMsg.c_str(), ld_pchrByteRq, 0, ld_intByteRqLen);<br />
<br />
	int ld_intTCPByteRqLen = ld_intByteRqLen + 2;<br />
	char *ld_pchrTCPByteRq = new char[ld_intTCPByteRqLen];<br />
	<br />
<big>	if(ld_intByteRqLen <= 255)<br />
	{<br />
		ld_pchrTCPByteRq[0] = 0;<br />
		ld_pchrTCPByteRq[1] = ld_intByteRqLen;<br />
	}<br />
	else<br />
	{<br />
		ld_pchrTCPByteRq[0] = ld_intByteRqLen / 256;<br />
		ld_pchrTCPByteRq[1] = ld_intByteRqLen % 256;<br />
	}</big><br />
	for(int i=2, j=0; i < ld_intTCPByteRqLen; i++, j++)<br />
	{<br />
		ld_pchrTCPByteRq[i] = ld_pchrByteRq[j];<br />
	}<br />
	<br />
	memcpy(ld_pchrDst, ld_pchrTCPByteRq, ld_intTCPByteRqLen);<br />
<br />
	delete [] ld_pchrByteRq;<br />
	delete [] ld_pchrTCPByteRq;<br />
}<br />
<br />
<br />
void CIsoMsg::mfc_voidHex2Byte(char *ld_pchrScr, char *ld_pchrDest, int ld_intStartOffset,int ld_intLen)<br />
{<br />
	char ld_chrBuf1[2], *ld_pchrBuf2;<br />
	ld_chrBuf1[1]=0;<br />
	int ld_intShiftLeft;<br />
	for(int i=0; i < (ld_intLen * 2); i++)<br />
	{<br />
		if(i%2 == 1) ld_intShiftLeft = 0; <br />
		else ld_intShiftLeft = 4;<br />
		ld_chrBuf1[0] = ld_pchrScr[ld_intStartOffset+i];<br />
        ld_pchrDest[i>>1] =  ld_pchrDest[i>>1] | strtol(ld_chrBuf1,&ld_pchrBuf2,16) << ld_intShiftLeft;<br />
	}<br />
}


There are two function I attached here. The length of those message (the first two bytes) is not as simple like the maximum is 0xffff. But it use the algorithm which I show you above (BIG formatted).
So I can't know the exactly length by conclude it would be 0xffff length.

Ian
AnswerRe: How to read bytes from winsock efficiently Pin
chandu0041-Oct-07 19:48
chandu0041-Oct-07 19:48 
GeneralRe: (Revision)How to read bytes from winsock efficiently Pin
Ontanggabe Parulian1-Oct-07 20:17
Ontanggabe Parulian1-Oct-07 20:17 
QuestionRe: How to read bytes from winsock efficiently Pin
David Crow2-Oct-07 2:30
David Crow2-Oct-07 2:30 
Questionobviously 0xffff, i.e 65535. Pin
chandu0042-Oct-07 2:38
chandu0042-Oct-07 2:38 
AnswerRe: How to read bytes from winsock efficiently Pin
David Crow2-Oct-07 2:41
David Crow2-Oct-07 2:41 
GeneralRe: How to read bytes from winsock efficiently Pin
chandu0042-Oct-07 2:45
chandu0042-Oct-07 2:45 
AnswerRe: How to read bytes from winsock efficiently Pin
Mark Salsbery1-Oct-07 20:10
Mark Salsbery1-Oct-07 20:10 
AnswerRe: How to read bytes from winsock efficiently (Problem SOLVED) Pin
Ontanggabe Parulian1-Oct-07 20:44
Ontanggabe Parulian1-Oct-07 20:44 
GeneralRe: How to read bytes from winsock efficiently (Problem SOLVED) Pin
Mark Salsbery2-Oct-07 5:04
Mark Salsbery2-Oct-07 5:04 
JokeRe: How to read bytes from winsock efficiently Pin
Moak9-Nov-07 1:25
Moak9-Nov-07 1:25 
QuestionAnyone know how to make something "auto-hide" ? Pin
USAFHokie801-Oct-07 14:07
USAFHokie801-Oct-07 14:07 
AnswerRe: Anyone know how to make something "auto-hide" ? Pin
Hamid_RT1-Oct-07 19:35
Hamid_RT1-Oct-07 19:35 
AnswerRe: Anyone know how to make something "auto-hide" ? Pin
Nelek1-Oct-07 21:42
protectorNelek1-Oct-07 21:42 
QuestionRe: Anyone know how to make something "auto-hide" ? Pin
David Crow2-Oct-07 2:34
David Crow2-Oct-07 2:34 
AnswerRe: Anyone know how to make something "auto-hide" ? Pin
USAFHokie802-Oct-07 12:19
USAFHokie802-Oct-07 12:19 
QuestionFlicker free painting with PNG images Pin
Leslie Sanford1-Oct-07 11:04
Leslie Sanford1-Oct-07 11:04 
AnswerRe: Flicker free painting with PNG images Pin
Mark Salsbery1-Oct-07 12:07
Mark Salsbery1-Oct-07 12:07 

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.