![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Of course not - take your time. I'm not paying you - I realise you're giving up your own free time to take a look.
|
|
|
|
|
|
#12 |
|
Professional Programmer
Join Date: Nov 2004
Posts: 250
Rep Power: 5
![]() |
Let's do this a bit differently, because your code has problems that keep me from getting the same error. Send me your project files so that I can get an exact duplicate of what you're seeing. That's much easier than me trying to wade my way through problematic code given as individual files but meant to be used as a whole.
|
|
|
|
|
|
#13 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Gotcha. Sorry for all the trouble this is taking. I'm using Visual C++ .NET - the project's at http://80.1.252.217/Sockets2.zip. If you replace the calls to server() or client() with the CreateThread function, it fails to build.
Thanks for the help. |
|
|
|
|
|
#14 |
|
Professional Programmer
Join Date: Nov 2004
Posts: 250
Rep Power: 5
![]() |
Ah, so much easier. The problem is a declaration mismatch. LPTHREAD_START_ROUTINE is defined with the following tag:
typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(LPVOID lpThreadParameter); typedef unsigned long (*PTHREAD_START_ROUTINE)(void *arg); unsigned long server(void *arg); int server(void); hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)server, &dwThrdParam, 0, &dwThreadID); By the way, your program has bugs. Most notable is this one: int Socket::error(const char *msg) {
int errNo = (long)WSAGetLastError();
std::cout << "Error #" << errNo << ": " << msg << std::endl;
//
// Comparing pointers, not strings. This wasn't intended.
//
if (msg != "WSAStartup")
WSACleanup();
return errNo;
}![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|