Click here to Skip to main content
15,896,153 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Stop removal of null characters Pin
David Crow25-Aug-04 10:14
David Crow25-Aug-04 10:14 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 10:26
Tom Wright25-Aug-04 10:26 
GeneralRe: Stop removal of null characters Pin
Rick York25-Aug-04 10:41
mveRick York25-Aug-04 10:41 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:20
Tom Wright25-Aug-04 11:20 
GeneralRe: Stop removal of null characters Pin
David Crow25-Aug-04 10:43
David Crow25-Aug-04 10:43 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:21
Tom Wright25-Aug-04 11:21 
GeneralRe: Stop removal of null characters Pin
David Crow25-Aug-04 11:27
David Crow25-Aug-04 11:27 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:48
Tom Wright25-Aug-04 11:48 
Okay, if I setup my string like this:
<br />
	char sHeader1[53]={"A"};<br />
	CString sHeader2;<br />
	sHeader2.Format("%s rest of my message here", sHeader1);<br />
	m_sConnectSocket.Send((LPCTSTR)sHeader2, strlen(sHeader2));<br />

I get this:
A rest of my message here

If I change my code to this:
char message[128];<br />
memset( message, 41, sizeof( message ) );<br />
strcpy( &message[53], " rest of message header here" );<br />
m_sConnectSocket.Send( message, 128 );<br />

I get this:
))))))))))))))))))))))))))))))))))))))))))))))))))))) rest of message header here

Now I know that the )'s are supposed to be A's I think I put in the wrong number for A.

So I replaced 41 with 0 and I got nothing.
I'm thinking that I cannot send anything with leading nulls....which if you think about it, is right....how would the system know the end of one packet and the beginning of another is it did not reference nulls as the end or beginning of something.

Tom Wright
tawright915@yahoo.com
GeneralRe: Stop removal of null characters Pin
Michael Dunn25-Aug-04 10:52
sitebuilderMichael Dunn25-Aug-04 10:52 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:23
Tom Wright25-Aug-04 11:23 
GeneralRe: Stop removal of null characters Pin
Michael Dunn25-Aug-04 12:02
sitebuilderMichael Dunn25-Aug-04 12:02 
GeneralRe: Stop removal of null characters Pin
Tom Wright26-Aug-04 6:14
Tom Wright26-Aug-04 6:14 
GeneralRe: Stop removal of null characters Pin
Joaquín M López Muñoz25-Aug-04 12:45
Joaquín M López Muñoz25-Aug-04 12:45 
GeneralRe: Stop removal of null characters Pin
Tom Wright26-Aug-04 6:00
Tom Wright26-Aug-04 6:00 
GeneralRe: Stop removal of null characters Pin
Abin26-Aug-04 1:21
Abin26-Aug-04 1:21 
GeneralRe: Stop removal of null characters Pin
GKarRacer26-Aug-04 8:05
GKarRacer26-Aug-04 8:05 
GeneralWow this is a mess Pin
palbano25-Aug-04 18:55
palbano25-Aug-04 18:55 
GeneralRe: Wow this is a mess Pin
Tom Wright26-Aug-04 5:54
Tom Wright26-Aug-04 5:54 
GeneralRe: Wow this is a mess Pin
palbano26-Aug-04 7:59
palbano26-Aug-04 7:59 
GeneralWindow Position Pin
Anthony988725-Aug-04 8:54
Anthony988725-Aug-04 8:54 
GeneralRe: Window Position Pin
Maximilien25-Aug-04 9:00
Maximilien25-Aug-04 9:00 
GeneralRe: Window Position Pin
Anthony988725-Aug-04 9:07
Anthony988725-Aug-04 9:07 
QuestionSaving password to registry? Pin
mcguile25725-Aug-04 8:16
mcguile25725-Aug-04 8:16 
AnswerRe: Saving password to registry? Pin
Antony M Kancidrowski25-Aug-04 9:48
Antony M Kancidrowski25-Aug-04 9:48 
AnswerRe: Saving password to registry? Pin
David Crow25-Aug-04 10:19
David Crow25-Aug-04 10:19 

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.