how to change title of a child dialog?
-
it is not working coz i will have to refer to child window first. how can i refer to child window? i hv implmented as: IRCNewSim* ptr1=NULL; Markcorr* ptr2=NULL; ptr1=(IRCNewSim*)AfxGetApp()->m_pMainWnd; ptr2=(Markcorr*)ptr1->GetActiveWindow(); ptr2->SetWindowText("Tower1 Scanner1"); thanks
Waht was return value of SetWindowText?
-
Waht was return value of SetWindowText?
appl is getting crashed and control is going into Setwindowtext void CWnd::SetWindowText(LPCTSTR lpszString) { ASSERT(::IsWindow(m_hWnd)); if (m_pCtrlSite == NULL) ::SetWindowText(m_hWnd, lpszString); else m_pCtrlSite->SetWindowText(lpszString); } m_hwnd is showing as NULL
-
appl is getting crashed and control is going into Setwindowtext void CWnd::SetWindowText(LPCTSTR lpszString) { ASSERT(::IsWindow(m_hWnd)); if (m_pCtrlSite == NULL) ::SetWindowText(m_hWnd, lpszString); else m_pCtrlSite->SetWindowText(lpszString); } m_hwnd is showing as NULL
So I think your problem is of hwnd ptr2.
-
So I think your problem is of hwnd ptr2.
-
i have a dialog based appication. when i click on a button on a dialog(1st dialog), it will open 1 dialog(2nd dialog) and when i click on button on this dialog(2nd dialog) another dialog box(3rd dialog) will get opened and i want to change title of this dialog(3rd dialog). thanks in advance
Are you wanting to set the window text of the 3rd dialog dynamically? In that case, you could pass it as a parameter to the constructor of the 3rd dialog class and have a string member variable initialized with that value and then call
SetWindowText()
inInitDialog()
. That sounds viable?It is a crappy thing, but it's life -^ Carlo Pallini
-
ok... do u hv any other suggetion abt how can i implement this by some other method? or can u give me some demo of this type of application? i will b very much greatful to u
How did you create your child dialog?
-
i have a dialog based appication. when i click on a button on a dialog(1st dialog), it will open 1 dialog(2nd dialog) and when i click on button on this dialog(2nd dialog) another dialog box(3rd dialog) will get opened and i want to change title of this dialog(3rd dialog). thanks in advance
Anjali Patil wrote:
...i want to change title of this dialog(3rd dialog).
Call
SetWindowText()
from within itsOnInitDialog()
method."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
That was not intentional
-
How did you create your child dialog?
-
Are you wanting to set the window text of the 3rd dialog dynamically? In that case, you could pass it as a parameter to the constructor of the 3rd dialog class and have a string member variable initialized with that value and then call
SetWindowText()
inInitDialog()
. That sounds viable?It is a crappy thing, but it's life -^ Carlo Pallini