Results 1 to 2 of 2

Thread: CreateThread compile error

  1. #1

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461

    CreateThread compile error

    hi when i use
    CreateThread(0,0, Client, 0, 0,&lpThreadID3);
    on

    DWORD WINAPI Client(void)
    {

    theClient = accept(hSocket,NULL,NULL);
    if (theClient == INVALID_SOCKET) {
    printf("Error at accept()");
    WSACleanup();
    return 0;
    }


    }


    i get this error in msvc++, im even following an example from msdn. can you help me?

    F:\C++\newprojects\Winsck\Server\Servermain.cpp(62) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void)' to 'unsigned long (__stdcall *)(void *)'
    None of the functions with this name in scope match the target type.
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The thread entry point needs a void * parameter.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width