Hey Guys,
I've been browsing this forum a while and decided to sign up, looks like a good place for help.
I'm new to C++, possibly been coding it about 1 week now and I've decided to make a IP Messenger.
I've got the code all worked out for getting an IP from the user, getting a Port, deciding if the user wants to host or connect to a host (if this makes any sense to you).
Anyway, what I have is a little problem creating loops, with Win32 when you create a while loop to say loop while variable A is set to TRUE then the application / dialog form crashes and I am unable to use it.
Another thing is, when you tell the application to run as a server, you tell it to accept the socket, for when the client connects, but the application stops responding, until the client connects, then jumps back into life!
For the loop, I'm after using the Recv() function from WinSock2.h to keep polling for new data from the client / server, for new messages transmitted which will then be displayed on a list. This will probably make more sense if you look at my code.
Bare in mind, my code will be scruffy, since I've thrown all this together from guides etc... as a starting point in C++.
I've been looking at the GetMessage() loop but I keep getting compile errors. What would be the best way in doing this?
Also don't take note of all the libraries I've included haha, that was when I was just testing different functions and things to include, never removed them once I was finished.
Thanks!
CODE BELOW.
Main.cpp :
http://www.pastebin.ca/raw/2390637
Resource.h :
http://www.pastebin.ca/raw/2390637
Resource.rc :
http://www.pastebin.ca/raw/2390640