Click here to Skip to main content
15,914,943 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CToolBar basic questions Pin
Mark Salsbery5-Feb-07 6:54
Mark Salsbery5-Feb-07 6:54 
QuestionRe: CToolBar basic questions Pin
PatrykDabrowski5-Feb-07 12:58
PatrykDabrowski5-Feb-07 12:58 
AnswerRe: CToolBar basic questions Pin
Mark Salsbery5-Feb-07 13:37
Mark Salsbery5-Feb-07 13:37 
QuestionXPCOM Creation Pin
johnalek5-Feb-07 0:53
johnalek5-Feb-07 0:53 
AnswerRe: XPCOM Creation Pin
_AnsHUMAN_ 5-Feb-07 1:16
_AnsHUMAN_ 5-Feb-07 1:16 
AnswerRe: XPCOM Creation Pin
Hamid_RT5-Feb-07 7:49
Hamid_RT5-Feb-07 7:49 
AnswerRe: XPCOM Creation Pin
ThatsAlok6-Feb-07 20:11
ThatsAlok6-Feb-07 20:11 
Questionrelated to network module Pin
sudhir.marni5-Feb-07 0:23
sudhir.marni5-Feb-07 0:23 
GeneralRe: related to network module Pin
johnalek5-Feb-07 1:12
johnalek5-Feb-07 1:12 
AnswerRe: related to network module Pin
David Crow5-Feb-07 3:01
David Crow5-Feb-07 3:01 
AnswerRe: related to network module Pin
Hamid_RT5-Feb-07 7:46
Hamid_RT5-Feb-07 7:46 
QuestionON Network module Pin
Member 35534025-Feb-07 0:17
Member 35534025-Feb-07 0:17 
AnswerRe: ON Network module Pin
Waldermort5-Feb-07 2:06
Waldermort5-Feb-07 2:06 
AnswerRe: ON Network module Pin
David Crow5-Feb-07 3:03
David Crow5-Feb-07 3:03 
AnswerRe: ON Network module Pin
Eytukan5-Feb-07 3:15
Eytukan5-Feb-07 3:15 
AnswerRe: ON Network module Pin
Hamid_RT5-Feb-07 7:42
Hamid_RT5-Feb-07 7:42 
QuestionMFC STATUS BAR PROBLEM Pin
T.RATHA KRISHNAN4-Feb-07 23:44
T.RATHA KRISHNAN4-Feb-07 23:44 
I've created a menu called Tools where in I have created a menu item called Preferences. If we click the Prefernces menu item Preferences Dialog Box will open. In that Dialog Box I have an edit box. The message entered in this edit box is displayed in the second panel of the status bar (i.e) panel no.1.

My Requirement is:
The second panel should be of a default size and it should grow according to the length of the message entered in the edit box.

How can I achieve this in MFC? Can any one help?

I have tried this also. But it didn't work.
CStatusBar::SetPaneInfo( int nIndex, UINT nID, UINT nStyle, int cxWidth );

The function that displays the message is:

void CPerspectiveDoc::OnShowMsg(CCmdUI* pCmdUI)
{
char str1[150];
//int len = message.GetLength();
sprintf(str1, "%s",message.GetString());
pCmdUI->Enable(TRUE);
pCmdUI->SetText((const char *)str1);
//m_wndStatusBar.SetPaneInfo(1, IDS_MESSAGE, SBPS_STRETCH, len);
}

When I remove the comment from the following code, it shows me an exception stating that "Unhandled exception at 0x7c1d71bb (MFC71.dll) in Perspective.exe: 0xC0000005: Access violation writing location 0x00000014."

The commented out line of code is:
//m_wndStatusBar.SetPaneInfo(1, IDS_MESSAGE, SBPS_STRETCH, len);

Any one Please help.





AnswerRe: MFC STATUS BAR PROBLEM Pin
kasturi_haribabu5-Feb-07 0:04
kasturi_haribabu5-Feb-07 0:04 
GeneralRe: MFC STATUS BAR PROBLEM Pin
T.RATHA KRISHNAN5-Feb-07 0:20
T.RATHA KRISHNAN5-Feb-07 0:20 
AnswerRe: MFC STATUS BAR PROBLEM Pin
#realJSOP5-Feb-07 0:07
professional#realJSOP5-Feb-07 0:07 
AnswerRe: MFC STATUS BAR PROBLEM Pin
#realJSOP5-Feb-07 0:29
professional#realJSOP5-Feb-07 0:29 
GeneralMFC STATUS BAR PROBLEM ADDITIONAL Pin
T.RATHA KRISHNAN5-Feb-07 1:10
T.RATHA KRISHNAN5-Feb-07 1:10 
GeneralRe: MFC STATUS BAR PROBLEM ADDITIONAL Pin
#realJSOP5-Feb-07 1:40
professional#realJSOP5-Feb-07 1:40 
QuestionRe: MFC STATUS BAR PROBLEM ADDITIONAL [modified] Pin
T.RATHA KRISHNAN5-Feb-07 17:40
T.RATHA KRISHNAN5-Feb-07 17:40 
AnswerRe: MFC STATUS BAR PROBLEM ADDITIONAL Pin
#realJSOP5-Feb-07 23:13
professional#realJSOP5-Feb-07 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.