But, everytime I refresh, the same copies of the IP addresses get displayed one below another. i.e. if i refresh it twice, the same set of ips get displayed twice one below another.
I want to display one IP only at one line(& not many copies of it) even if I refresh many times.
Is Linked list the only solution to this problem?????(I have been suggested so)
Sorry, I couldn't understand your problem...
But, perhaps, replacing an Edit control with the LisBox would solve your problem?
Or getting rid of UpdateData() and using CEdit methods like SetSel/ReplaceSel could help you?
Also tell us what m_IPAddresses, SendersIP and MultiLine are. What type of variables are they?
Also, which IP addresses you want to display one after the other? Do you have 1 list of IP addresses that you want to show in a list or what?
I am putting the required files also, & telling it in short here also,
CString m_IPAddresses -> the variable of the read only exit box
CString SendersIP -> the variable used in the function REceiveFrom(), to get the IP of machine which sends message.
Multiline & the VSCroll are true.
Initially I will transmit the broadcast message, the machines which are listening to me will send reply. SO, I should display the IP of all the machines which are listening to broadcast & replying, one below another.....just like LAN messenger / ip messenger
I don't have time to analyse the code in details.
But did you run this in a debugger?
I would run it in a debugger, put a breakpoint at "ChekReceived = ReceiveFrom( ReceivedBuf,4096 , SendersIP, SendersPort );" and check the values in the debugger. It's probably not a problem with displaying the IP address but you might be getting the wrong addresses in SendersIP.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.