So if you receive a TCP/IP packet you're theoretically able to extract the MAC address? How?
Every packet you get is going to have a destination and source MAC address. If you strip off the layer 3 (TCP/IP) header, you'll be left with the layer 2 header which will contain MAC addresses. It will have the destination (your) MAC address, along with the source which will just be sending device. This doesn't mean it will be the sending host MAC address though. If this packet went through a router, it will be the MAC address for the inside interface of that router.
one other problem: i need to clear the listbox when the user clicks another ip address because the MAC address from when the first ip address is still displayed.
i know to delete items from a listbox is m_ClientIdList.ResetContent(); i just don't know where is the correct place to put it
So what if the client would send a specific start/end message. Like "Hello"+MAC address as the begin and "Bye" as the end marker?
Currently you push_back() a client anytime you receive something, but what if the same client sends more then just one message?
I'd suggest that you turn clients into a map. The key for this map is the ip address (as a string). And add a member variable that takes the MAC address to your ClientInfo
Whenever you detect that a new client connects to your system (map.find(ip address) == map.end()) you update your listbox (which uses the map)
but the client isn't sending any messages. this isn't a chat application
the reason for this program was to receive the ip and mac address from clients