Displaying data in edit control

I am using recv() to receive data represent characters from a socket. The problem I am facing is how to display this data in Edit control. When I display the received data just for checking using AfxMessageBox function, I get the received text with garbage character appended to the text. I think the problem is with the way of displaying. Any suggestion please
ammarwmAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dhymesConnect With a Mentor Commented:
Are you interfacing with some type of Gateway that is rapping an envelope around the received socket data? Normally the control characters in the envelope is Non displayable binary datacharacters? Your edit control does not know what to do with the control characters that it is receiving.

AFXMessageBox uses a CString as it's buffer to store data, so it will store up to, but not including a Null value of whatever you give it.

An edit control is expecting only displayable ascii values along with TABS and a few other exceptable values. The edit control has it's own set of control characters and delimiters that are used to control how the data is displayed to the user. You will have to filter out all control/binary characters prior to populating your edit control with the received data.

Regards,
Dave
0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

No, I dont think, it is the prob with the way of displaying. The text may be containing some junk values. U may have to trim it up before displaying it.
Just debug and see what character r u getting.

Try it out.
VinExpert
0
All Courses

From novice to tech pro — start learning today.