Click here to Skip to main content
16,005,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Setting extended style ( gridlines) in CListView Pin
Mark Salsbery28-Aug-07 6:46
Mark Salsbery28-Aug-07 6:46 
GeneralRe: Setting extended style ( gridlines) in CListView Pin
Vaclav_28-Aug-07 8:02
Vaclav_28-Aug-07 8:02 
QuestionDeleting a returned array Pin
MALDATA27-Aug-07 15:43
MALDATA27-Aug-07 15:43 
AnswerRe: Deleting a returned array Pin
KaЯl27-Aug-07 22:00
KaЯl27-Aug-07 22:00 
AnswerRe: Deleting a returned array Pin
David Crow28-Aug-07 2:28
David Crow28-Aug-07 2:28 
GeneralRe: Deleting a returned array Pin
MALDATA28-Aug-07 8:43
MALDATA28-Aug-07 8:43 
GeneralRe: Deleting a returned array Pin
David Crow28-Aug-07 8:46
David Crow28-Aug-07 8:46 
QuestionIs it not possible to use SetWindowText() within ::OnInitDialog ? Pin
abiemann27-Aug-07 14:35
abiemann27-Aug-07 14:35 
what I'm trying to so is set up my complete Dialog before it is shown to the user.
Hence, I want to populate some CStatic's and a CEdit. However, I keep getting an Assert error when I populate the CStatic with text. (haven't gotten to the other CStatic's and CEdit yet).


To summarize what I've got and to pick on the first Assert error


the Dialog Editor shows that the static text ID is: IDC_FW_VERSION

within the Dialog's .h file, the static text is listed as:
public: CStatic m_staticFwVersion;

within the Dialog's .cpp file, ::DoDataExchange():
DDX_Control(pDX, IDC_FW_VERSION, m_staticFwVersion);

However, this code (within OnInitDialog) fails every time with the Assert error:
<br />
    CString strVersion;<br />
    strVersion.Format("FW Ver %x.%02x, CheckSum = %03x, POST %x %s%s", <br />
            (Attributes.VersionNumber >>  8) & 0xff,<br />
            (Attributes.VersionNumber >>  0) & 0xff,<br />
            nChecksum, nPostResult,(!nPostResult) ? "PASS" : "FAIL",PostResults);<br />
    m_staticFwVersion.SetWindowText(strVersion);<br />

the CString comes out to be a typical null terminated string.

The debugger shows me the failure point:
void CWnd::SetWindowText(LPCTSTR lpszString)<br />
{<br />
	ENSURE(this);<br />
	ENSURE(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));


both, m_hWnd and m_pCtrlSite are 0

so where should I initialize the static texts ?
AnswerRe: Is it not possible to use SetWindowText() within ::OnInitDialog ? Pin
Chris Losinger27-Aug-07 15:26
professionalChris Losinger27-Aug-07 15:26 
GeneralRe: Is it not possible to use SetWindowText() within ::OnInitDialog ? Pin
abiemann28-Aug-07 6:40
abiemann28-Aug-07 6:40 
GeneralRe: Is it not possible to use SetWindowText() within ::OnInitDialog ? Pin
Chris Losinger28-Aug-07 7:05
professionalChris Losinger28-Aug-07 7:05 
GeneralRe: Is it not possible to use SetWindowText() within ::OnInitDialog ? Pin
abiemann29-Aug-07 6:47
abiemann29-Aug-07 6:47 
AnswerRe: Is it not possible to use SetWindowText() within ::OnInitDialog ? Pin
sheshidar27-Aug-07 20:56
sheshidar27-Aug-07 20:56 
AnswerRe: Is it not possible to use SetWindowText() within ::OnInitDialog ? Pin
Iain Clarke, Warrior Programmer28-Aug-07 1:01
Iain Clarke, Warrior Programmer28-Aug-07 1:01 
QuestionRe: Is it not possible to use SetWindowText() within ::OnInitDialog ? Pin
David Crow28-Aug-07 2:26
David Crow28-Aug-07 2:26 
QuestionPreTranslateMessage return assertion Pin
ArielR27-Aug-07 13:15
ArielR27-Aug-07 13:15 
QuestionRe: PreTranslateMessage return assertion Pin
Mark Salsbery27-Aug-07 13:40
Mark Salsbery27-Aug-07 13:40 
AnswerRe: PreTranslateMessage return assertion Pin
Nishad S27-Aug-07 22:08
Nishad S27-Aug-07 22:08 
GeneralRe: PreTranslateMessage return assertion Pin
ArielR28-Aug-07 1:13
ArielR28-Aug-07 1:13 
GeneralRe: PreTranslateMessage return assertion Pin
Nishad S29-Aug-07 2:17
Nishad S29-Aug-07 2:17 
GeneralRe: PreTranslateMessage return assertion Pin
ArielR29-Aug-07 9:22
ArielR29-Aug-07 9:22 
GeneralRe: PreTranslateMessage return assertion Pin
Nishad S29-Aug-07 17:45
Nishad S29-Aug-07 17:45 
QuestionInterface freezes breifly while using drop down menus Pin
Kiran Satish27-Aug-07 13:12
Kiran Satish27-Aug-07 13:12 
QuestionBlind SQL Injection Pin
half-life27-Aug-07 13:11
half-life27-Aug-07 13:11 
QuestionHow to simulate keyboard input in windows enviroment? Pin
zipliu27-Aug-07 8:20
zipliu27-Aug-07 8:20 

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.