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