cannot convert parameter

Home Forums Discussions General cannot convert parameter

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5181
    muller
    Participant

      Please, help me…

      	g_dispatcher = lib_CreateThread(NULL, 0, dispatcher, (LPVOID)config, 0, &thread_id);

      lib_CreateThread(NULL, 0, restart_thread, config, 0, &thread_id);

      ‘_beginthreadex’ : cannot convert parameter 3 from ‘DWORD (__stdcall *)(LPVOID)’ to ‘unsigned int (__stdcall *)(void *)’

      #6571
      Vadim Smirnov
      Keymaster

        DWORD is defined as unsigned long which is a different type than unsigned int. Although both types has the same implementation (32 bit unsigned value) in MS Windows compiler generates an error.

        You have two options to resolve this:

        1) Change your thread function definition
        2) Explicitly type cast the function pointer

        #6572
        muller
        Participant

          2) Do not work.

          g_dispatcher = lib_CreateThread(NULL, 0, (LPVOID)dispatcher, (LPVOID)config, 0, &thread_id);
          //'_beginthreadex' : cannot convert parameter 3 from 'LPVOID' to 'unsigned int (__stdcall *)(void *)'

          1) How to edit function? sample, please.

          Maybe I get this error because of the function prototype fault parameter?

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.