Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Thread in DLL

Thread in DLL

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aman2006
    wrote on last edited by
    #1

    Hey Can we Creat Threads in DLL??? Shailesh

    J 1 Reply Last reply
    0
    • A aman2006

      Hey Can we Creat Threads in DLL??? Shailesh

      J Offline
      J Offline
      John M Drescher
      wrote on last edited by
      #2

      Yes, you can. i do this all the time. I use a thread pool created in a dll in my main application. John

      A 1 Reply Last reply
      0
      • J John M Drescher

        Yes, you can. i do this all the time. I use a thread pool created in a dll in my main application. John

        A Offline
        A Offline
        aman2006
        wrote on last edited by
        #3

        Hello John I am creating a Win32DLL in which i am passing the address of a function like extern "C" __declspec(dllexport) BOOL ReadCard(char *pData) { if(g_hPort == NULL) { strcpy(pData,"COM port is not opened"); return false; } g_hThreadRead = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MyMSR_PortReadThreadMgr, 0, 0,&dwThreadID); return true; } But this thread is created but not executing the functions. I have declared the function like DWORD WINAPI MyMSR_PortReadThreadMgr(LPVOID param) { } But it is not going to this function can you suggest me some thing Thanks in advance Shailesh CeateThread(

        B 1 Reply Last reply
        0
        • A aman2006

          Hello John I am creating a Win32DLL in which i am passing the address of a function like extern "C" __declspec(dllexport) BOOL ReadCard(char *pData) { if(g_hPort == NULL) { strcpy(pData,"COM port is not opened"); return false; } g_hThreadRead = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MyMSR_PortReadThreadMgr, 0, 0,&dwThreadID); return true; } But this thread is created but not executing the functions. I have declared the function like DWORD WINAPI MyMSR_PortReadThreadMgr(LPVOID param) { } But it is not going to this function can you suggest me some thing Thanks in advance Shailesh CeateThread(

          B Offline
          B Offline
          bikram singh
          wrote on last edited by
          #4

          aman2006 wrote: But this thread is created How did you check this? aman2006 wrote: But it is not going to this function And this ? Code seems fine to me.. Bikram Singh I believe we should all pay our tax with a smile. I tried - but they wanted cash.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups