Help: Update the Progress Bar
I'm using
MFC to do a small routine with a standard progress bar. I
saw some old posts in this ng with code for updating a progress bar,
such as:
CProgressCtrl *pMyBar = (CProgressCtrl *)GetDlgItem( IDC_YOURBAR);
pMyBar->SetRange(0 , 100); // min 0 max 100
pMyBar->SetPos( 50 ); //half way
pMyBar->SetPos( 75 ); / 3/4 of the way ...
The problem is, I've created a separate class. A button from the
window where the progress bar is located is calling a function of that
new class, which is actually doing all the work. So, I have to update
the progress bar from that function, but since it's outside of my
CMyDlg, (CProgressCtrl*)GetDlgItem as shown above doesn't work. Do I
have to use GetDlgItem(hwnd, ID) instead? If so, how do I get the HWND
for the parent window (which happens to be the only main window in the
project)? Is there another easier way of updating a progress bar.
This seems like it should be easy, yet I haven't worked with MFC much...
Thanks in advance.
Sent via Deja.com http://www.*-*-*.com/
Before you buy.