BlackSun
December 14th, 2004, 01:26 PM
Ok so I'm doing an app in VC++ 6. It's an MNC app, and I'm trying to make it multithreaded, and now I have of course run into a problem I can't solve...
I've read articles on msdn, but I seem to be too stupid to get them.
So heres my problem :
I have my dialog here, and in it I have a function that I'm trying to get to work.
It looks something like this ;
UINT MyClass::Server (LPVOID pParam)
{
CSocket sock;
// some more declarations and stuff done, so far all is good
if (!sock.Create(the_port))
MessageBox("Couldn't create..."); // Crashes before I'm here ...
}
So, why does it crash when I'm using CSocket in the thread ? Tried using SOCKET too, and then it doesn't crash, but then I can't do anything with it ....
TIA
BlackSun
I've read articles on msdn, but I seem to be too stupid to get them.
So heres my problem :
I have my dialog here, and in it I have a function that I'm trying to get to work.
It looks something like this ;
UINT MyClass::Server (LPVOID pParam)
{
CSocket sock;
// some more declarations and stuff done, so far all is good
if (!sock.Create(the_port))
MessageBox("Couldn't create..."); // Crashes before I'm here ...
}
So, why does it crash when I'm using CSocket in the thread ? Tried using SOCKET too, and then it doesn't crash, but then I can't do anything with it ....
TIA
BlackSun