you cannot create a thread from a class member function using CreateThread() unless it is static. you can do it with boost::thread and boost::bind, so I would suggest looking at those to see if they will work for you, if this is something that you need to do with non-static functions.

Sure. Create a function (either a global function, or a static member function of a class) that, in turn, invokes the member function on an object.

Right 98% of the time, and don't care about the other 3%.

If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Ok, i will try. But i have question about crypt my connection, i would like to use openssl lib. So should it be done?

1. Client is sending to server his public key
2. Server random big number and crypt it with client's public key
3. Client use this big number to create secret key and send to server
4. Server use this same big number to create his secret key and send to client

And then server is using client's secret key to crypt and client is using server's secret key to crypt?

Units/ClientHandler.cpp:122: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say `&ClientHandler::ServeClient'

This is right, actually. You need to compile boost and link to it (which the library should fix by itself, I believe). There are instructions at the boost homepage, or alternatively there might be binaries ready. I know there are for Visual Studio at least.
Oh, and don't cast NextFreeSpace to LPVOID.