CODE
HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled)
I've got this:
CODE
if( ( 3 == pGetSourceTextData->iData ) && ( ( !pGetSourceTextData->bItemData ) ) ) {
pGetSourceTextData->szText = L"Title";
if (sortCol == pGetSourceTextData->iData) {
pGetSourceTextData->nTextFormatInfo = 1;
pGetSourceTextData->pTextFormatInfo = formatInfoRed;
}
bHandled = TRUE;
}
pGetSourceTextData->iData is the "Data Association" that you specify for the presenter in the XUI tool.
pGetSourceTextData->bItemData lets you determine if the presenter is in a sub-control (item of a listbox), or the control itself.
in this case formatInfoRed looks like this:
CODE
formatInfoRed[0].nStart = 0;
formatInfoRed[0].nEnd = 255;
formatInfoRed[0].dwTextColor = 0xffff0000;
formatInfoRed[0].hBrush = NULL;
Be absolutely certain that the memory you pass as your pTextFormatInfo isn't allocated on the stack, because it's likely to be gone/different/overwritten by the time OnGetSourceDataText() gets around to actually looking at it.
-node