SM
2010-05-14 14:32:52 UTC
Hi,
I have a dialog box(About dialog) and it contains three static text
controls.
Now I need to set the value to the one static control in run time, so
I changed the ID from IDC_STATIC to IDC_Test
CSimpleDialog<IDD_TESTDLG> dlgTest;
//dlgTest.SetDlgItemTextA(IDC_Test,_T("Test"));
//GetDlgItem(IDC_SOC_Version).SetDlgItemTextA(IDC_Test,_T("Test"));
dlgTest.DoModal(m_hWnd);
GetDlgItem(IDC_SOC_Version).SetDlgItemTextA(IDC_SOC_Version,_T("Test"));
while running the application i'm getting assertion as
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: ...\AllVCLanguageSamples\C++\MFC\ole\TstCon\Release
\TstCon32.exe
File: d:\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlwin.h
Line: 1320
Expression: ::IsWindow(m_hWnd)
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
---------------------------
I tried moving the getdlgitem before domodal and it also throw error.
Tried SetDlgItemTextA , same error only.
How can I set value to static text control?
Thanks,
Sony
I have a dialog box(About dialog) and it contains three static text
controls.
Now I need to set the value to the one static control in run time, so
I changed the ID from IDC_STATIC to IDC_Test
CSimpleDialog<IDD_TESTDLG> dlgTest;
//dlgTest.SetDlgItemTextA(IDC_Test,_T("Test"));
//GetDlgItem(IDC_SOC_Version).SetDlgItemTextA(IDC_Test,_T("Test"));
dlgTest.DoModal(m_hWnd);
GetDlgItem(IDC_SOC_Version).SetDlgItemTextA(IDC_SOC_Version,_T("Test"));
while running the application i'm getting assertion as
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: ...\AllVCLanguageSamples\C++\MFC\ole\TstCon\Release
\TstCon32.exe
File: d:\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlwin.h
Line: 1320
Expression: ::IsWindow(m_hWnd)
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
---------------------------
I tried moving the getdlgitem before domodal and it also throw error.
Tried SetDlgItemTextA , same error only.
How can I set value to static text control?
Thanks,
Sony