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. Using UI-Thread

Using UI-Thread

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

    On regard [http://www.codeproject.com/script/comments/forums.asp?msg=1994839&forumid=1647&XtraIDs=1647&sd=20+Jan+2007&ed=20+Apr+2007&author=cdrain&stype=1#xx1994839xx](<a href=)[^]" rel="nofollow">comment Thanks a lot for the help... ok I'm able to create a UI-Thread from my MainWnd as I need to get the ActiveX functionality. My Activex must fill the grid contained on the MainWnd, while the progressBar is incremented. So I set the timer, that increment the progressbar on the OnTimer event, and create the ui-thread using this code I use: thread = new CMyThread(); //Set parameter I need on the ActiveX // Include the pointer to the grid (is it right?) thread->GripPointer= GridPointer; thread->par2 = par2; thread->par3 = par3; thread->CreateThread(); On my ui-thread code i fill the grid on the Run() method and at the end of the operation I PostMessage(..) to the MainWnd and here I close the ui-thread sending a PostMessage(WM_INFORM_CLOSE, 0, 0);. At Run-Time it gives me an error "Not valid pointer' when i call the function to fill the grid on the ui-thread. WHY? - Where I need to use the ::CoMarshalInterThreadInterfaceInStream(...) and ::CoGetInterfaceAndReleaseStream(...) method you said, and witch is they're scope? (Sorry I'm newer in this use ) - Have you an example code? Another question: But can I manage a graphic component of the MainWnd (the grid) from the ui-thread?? Is this my problem? Thanks a lot

    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