I'm having a really hard time understanding why my CXuiTextElements don't always respond to SetText(). It's reproducible, but not consistent. I initially thought it had to do with doing long operations immediately after doing the SetText not allowing a PAINT to get through...but I'm completely discounting that idea now.
Anyway, the control is defined as such in the class:
CODE
CXuiTextElement m_TitleForHeading;
And the OnInit() function does this:
CODE
HRESULT hr = GetChildById( L"XuiTextTitleForHeading", &m_TitleForHeading);
DebugMsg("HRESULT IS %x", hr);
Of course, the HRESULT is always S_OK;
Later I do this:
CODE
hr = m_TitleForHeading.SetText(L"DLC Is For (All)");
DebugMsg("HR is %x", hr);
And that *always* seems to work.
Based on some keydown events, I then do:
CODE
hr = m_TitleForHeading.SetText(L"DLC Is For (Have)");
DebugMsg("HR2 is %x", hr);
which seems to *never* work, but hr is always S_OK;
Oddly enough, if I replace that code with this:
CODE
hr = XuiTextElementSetText(m_TitleForHeading, L"DLC Is For (Have)");
DebugMsg("HR5 is %x", hr);
It seems to work sometimes, but not always.
Anyway, please tell me that I'm doing something really stupid, and this should always work...Well, I know it always *should* work...can anyone lend a hand and explain this behavior please?
Thanks.