AnswerTheMan
asked on
Globalizing the StausBar
I'm a VisualBasic expert. i Used to be a CPP expert when DOS was around.
now, trying MFC - i found that unlike VB - the Statusbar is not a GLOBAL resource (or whatever u call it....).
in VB you can address and change the StatusBar text from anywhere in your code because it's a PUBLIC control of the
form it belongs to which is PUBLIC itself.
is there a way in MFC to simplify usage of the code from
anywhere to change text in statusbar panels ?
now, trying MFC - i found that unlike VB - the Statusbar is not a GLOBAL resource (or whatever u call it....).
in VB you can address and change the StatusBar text from anywhere in your code because it's a PUBLIC control of the
form it belongs to which is PUBLIC itself.
is there a way in MFC to simplify usage of the code from
anywhere to change text in statusbar panels ?
ASKER
tnx SteveGTR, but your answer is not an answer to the question i asked.
here is MSDN page reffering to the function you suggested :
-------------------------- ---------- ---------- ---------- -----
CHtmlView::GetStatusBar
BOOL GetStatusBar( ) const;
Return Value
Nonzero if the status bar can be displayed; otherwise zero.
Remarks
Call this member function to determine whether the WebBrowser control displays a status bar.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
-------------------------- ---------- ---------- ---------- ---------- ----
1) who talked about the CLASS CHtmlView ???
2) i did not asked for a Boolean to know if the StatusBar can be displayed.
3) i did not mentioned WebBrowser control in my question.
4) Internet Explorer ???
here is MSDN page reffering to the function you suggested :
--------------------------
CHtmlView::GetStatusBar
BOOL GetStatusBar( ) const;
Return Value
Nonzero if the status bar can be displayed; otherwise zero.
Remarks
Call this member function to determine whether the WebBrowser control displays a status bar.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
--------------------------
1) who talked about the CLASS CHtmlView ???
2) i did not asked for a Boolean to know if the StatusBar can be displayed.
3) i did not mentioned WebBrowser control in my question.
4) Internet Explorer ???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CHtmlView??? I wasn't referring to CHtmlView... I was referring to CMainFrame::GetStatusBar() . Remember in C++ that you may have functions with the same name... Try out my original code and see that it will work. It is the same as that proposed by kenghwang.
Good Luck,
Steve
Good Luck,
Steve
ASKER
Ok, kenghwang. it was all my mistake.
what you suggested is exactly what i did before i put the question here, but
i was sure that the CMainFrame header is called MainFrame.h....so that's
why my #include raised errors.....
only in your answer i've noticed that the file name is MainFrm.h... and then
my privius code worked fine.
what you suggested is exactly what i did before i put the question here, but
i was sure that the CMainFrame header is called MainFrame.h....so that's
why my #include raised errors.....
only in your answer i've noticed that the file name is MainFrm.h... and then
my privius code worked fine.
CStatusBar* pStatusBar =
((CMainFrame*) AfxGetMainWnd())->GetStatu
I hope this helps.