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. HWND to a UIThread

HWND to a UIThread

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionworkspace
2 Posts 2 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.
  • D Offline
    D Offline
    David_Leikis
    wrote on last edited by
    #1

    I am trying to create a thread to monitor a USB-connected ADC module. Its driver uses a callback function for the configuration of the module. It requires a CWnd handle given to it such that when it has a buffer filled, it sends a OLDA_WM_BUFFER_DONE message to the thread. I created a UIThread so that it would have a message handler and I could create my OnBufferDone function. (Which is working and tested in a single thread situation.) It needs to be in a separate thread so that I can empty the buffer quickly and move the sample data into my internal buffers and return it back to the ADC module driver before the next buffer_full message comes in. Does anyone know how to create or get a HWND for a UIThread so that this driver can know where to send messages to my thread? Thanks in advance, Dave :((

    K 1 Reply Last reply
    0
    • D David_Leikis

      I am trying to create a thread to monitor a USB-connected ADC module. Its driver uses a callback function for the configuration of the module. It requires a CWnd handle given to it such that when it has a buffer filled, it sends a OLDA_WM_BUFFER_DONE message to the thread. I created a UIThread so that it would have a message handler and I could create my OnBufferDone function. (Which is working and tested in a single thread situation.) It needs to be in a separate thread so that I can empty the buffer quickly and move the sample data into my internal buffers and return it back to the ADC module driver before the next buffer_full message comes in. Does anyone know how to create or get a HWND for a UIThread so that this driver can know where to send messages to my thread? Thanks in advance, Dave :((

      K Offline
      K Offline
      KaRl
      wrote on last edited by
      #2

      Have you had a look to PostThreadMessage[^] ? HTH, K.


      I hurt so bad inside I wish you could see the world through my eyes It stays the same I just wanna laugh again

      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