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. How to launch a progressbar in an mfc dll?

How to launch a progressbar in an mfc dll?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestionlearningworkspace
5 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
    ns
    wrote on last edited by
    #1

    I have an MFC dll which has no gui, and I dont see a Resource tab in the development environment on which I could drag a CProgressCtrl. I want to launch a progressbar from this dll, and don't really want to do message loops and such which I would need if I used CreateWindow(). Appreciate your input, sb

    C 1 Reply Last reply
    0
    • N ns

      I have an MFC dll which has no gui, and I dont see a Resource tab in the development environment on which I could drag a CProgressCtrl. I want to launch a progressbar from this dll, and don't really want to do message loops and such which I would need if I used CreateWindow(). Appreciate your input, sb

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      Ugly idea, but what if you create the progress bar and then call the window method with WM_PAINT to get it drawn when you need it? No idea how that would behave...

      > The problem with computers is that they do what you tell them to do and not what you want them to do. <

      N 1 Reply Last reply
      0
      • C Code o mat

        Ugly idea, but what if you create the progress bar and then call the window method with WM_PAINT to get it drawn when you need it? No idea how that would behave...

        > The problem with computers is that they do what you tell them to do and not what you want them to do. <

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

        From within the dll, I did this

        // Create a smooth child progress control.
        myCtrl = new CProgressCtrl();
        myCtrl->Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, CRect(10,10,200,30),
        (CWnd*)this, 100);

        where the last parameter (100) is just a number I picked out of thin air. I don't know what I should put there. So when I ran the project that calls this dll, it ran, but no progress bar showed up... ???

        C 1 Reply Last reply
        0
        • N ns

          From within the dll, I did this

          // Create a smooth child progress control.
          myCtrl = new CProgressCtrl();
          myCtrl->Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, CRect(10,10,200,30),
          (CWnd*)this, 100);

          where the last parameter (100) is just a number I picked out of thin air. I don't know what I should put there. So when I ran the project that calls this dll, it ran, but no progress bar showed up... ???

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          What is "this"? You need a valid window where you specified "this", where do you want your progress bar to appear? I think you could be better off with making a message loop...it's not that complicated really.

          > The problem with computers is that they do what you tell them to do and not what you want them to do. <

          N 1 Reply Last reply
          0
          • C Code o mat

            What is "this"? You need a valid window where you specified "this", where do you want your progress bar to appear? I think you could be better off with making a message loop...it's not that complicated really.

            > The problem with computers is that they do what you tell them to do and not what you want them to do. <

            N Offline
            N Offline
            ns
            wrote on last edited by
            #5

            There aren't any CDialog type windows, and 'this' is just some abstract class where I have the time-stepping loop. Another thing I tried: Even though it's a dll, I tried adding a form to it, and dragged a progressbar on it, but then didn't quite know how to invoke this form from my abstract class. I'll look up the message loop idea. Thanks for the input. sb

            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