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 buttons

Thread buttons

Scheduled Pinned Locked Moved C / C++ / MFC
helpdesignquestion
3 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.
  • N Offline
    N Offline
    Nikz2
    wrote on last edited by
    #1

    Hi. Sry to bother. I am creating some buttons in a UI-thread. And they creats just fine. Unique thing that bothers me, is that they don't draw itselfs. So i can use them, but i can't see them. I am using gdiplus to draw the buttons. I start it at the application thread. (i don't know if i should start it at my own thread too? and if i do it, sometimes the application doesn't starts, but doesn't matter the problem persists) So what could i do to make visible my buttons? (they have visible style and showwindow sw_show etc) (when i do this without thread it all looks fine) And other problem that i noticed, when the application is closed it calls the destructor of buttons created by my thread, so it raise exception. So.. can you help me? =) Tnx for any help.

    D 1 Reply Last reply
    0
    • N Nikz2

      Hi. Sry to bother. I am creating some buttons in a UI-thread. And they creats just fine. Unique thing that bothers me, is that they don't draw itselfs. So i can use them, but i can't see them. I am using gdiplus to draw the buttons. I start it at the application thread. (i don't know if i should start it at my own thread too? and if i do it, sometimes the application doesn't starts, but doesn't matter the problem persists) So what could i do to make visible my buttons? (they have visible style and showwindow sw_show etc) (when i do this without thread it all looks fine) And other problem that i noticed, when the application is closed it calls the destructor of buttons created by my thread, so it raise exception. So.. can you help me? =) Tnx for any help.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Why not create the buttons in the primary thread?

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      N 1 Reply Last reply
      0
      • D David Crow

        Why not create the buttons in the primary thread?

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        N Offline
        N Offline
        Nikz2
        wrote on last edited by
        #3

        Well.. It's complicated. It's not a simple button... That's why i tryed to do it in a thread, but i followed your idea and made instead of CreateButton(...) PostMessage(...) and it works. But i have certain troubles with it. For example i create one button, later other that have to works with previously created button. So how can i check that the message stack is empty?

        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