Click here to Skip to main content
15,886,019 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting access Violation Using CDialog::Pretranslate while stepping thru code using Visual Studio Debugger Pin
ForNow29-May-12 16:11
ForNow29-May-12 16:11 
GeneralRe: Getting access Violation Using CDialog::Pretranslate while stepping thru code using Visual Studio Debugger Pin
Richard Andrew x6429-May-12 16:21
professionalRichard Andrew x6429-May-12 16:21 
GeneralRe: Getting access Violation Using CDialog::Pretranslate while stepping thru code using Visual Studio Debugger Pin
enhzflep29-May-12 20:03
enhzflep29-May-12 20:03 
QuestionCombining multiple standalone applications as an application suite Pin
wxShayan29-May-12 3:38
wxShayan29-May-12 3:38 
AnswerRe: Combining multiple standalone applications as an application suite Pin
Albert Holguin29-May-12 4:19
professionalAlbert Holguin29-May-12 4:19 
GeneralRe: Combining multiple standalone applications as an application suite Pin
wxShayan29-May-12 19:02
wxShayan29-May-12 19:02 
GeneralRe: Combining multiple standalone applications as an application suite Pin
Albert Holguin31-May-12 10:17
professionalAlbert Holguin31-May-12 10:17 
QuestionChange Item Text Color - CListCtrl Pin
AmbiguousName29-May-12 1:45
AmbiguousName29-May-12 1:45 
hello guys... I am trying to change the text color of an item in a CListCtrl in which I am successful, thanx to some online tutorials. But now I am trying to change text color based on the value of a static boolean variable. Here is what I am trying

void CMainDlg::OnStatusList_CutomDraw(NMHDR *pNMHDR, LRESULT *pResult)
{
    LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);
    NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
	
    *pResult = CDRF_DODEFAULT;

    if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
	*pResult = CDRF_NOTIFYITEMDRAW;
    else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
    {
	COLORREF crText;

	if(IsItemNumEven) // static BOOL IsItemNumEven
	   crText = RGB(255,0,0);
	else
	   crText = RGB(0,255,0);

	pLVCD->clrText = crText;
    }

    *pResult = CDRF_DODEFAULT;
}

This piece of code generates no error but it does not change the color either. If I remove the condition on IsItemNumEven, then it works fine. Just for general info, can I do something like this
AddToList("Item Index is Even");
MyListControl.SendMessage();  // something here so that I can manually change the item text color

Thanks for any pointers.

This world is going to explode due to international politics, SOON.

QuestionRe: Change Item Text Color - CListCtrl Pin
CPallini29-May-12 2:40
mveCPallini29-May-12 2:40 
AnswerRe: Change Item Text Color - CListCtrl Pin
AmbiguousName29-May-12 20:16
AmbiguousName29-May-12 20:16 
QuestionRe: Change Item Text Color - CListCtrl Pin
CPallini29-May-12 21:18
mveCPallini29-May-12 21:18 
QuestionRe: Change Item Text Color - CListCtrl Pin
David Crow29-May-12 3:34
David Crow29-May-12 3:34 
Questionproblem with tamplate deque Pin
a1_shay27-May-12 20:07
a1_shay27-May-12 20:07 
AnswerRe: problem with tamplate deque Pin
«_Superman_»27-May-12 21:33
professional«_Superman_»27-May-12 21:33 
GeneralRe: problem with tamplate deque Pin
CPallini27-May-12 21:39
mveCPallini27-May-12 21:39 
GeneralRe: problem with tamplate deque Pin
a1_shay27-May-12 23:36
a1_shay27-May-12 23:36 
GeneralRe: problem with tamplate deque Pin
CPallini27-May-12 23:51
mveCPallini27-May-12 23:51 
AnswerRe: problem with tamplate deque Pin
CPallini27-May-12 21:38
mveCPallini27-May-12 21:38 
AnswerRe: problem with tamplate deque Pin
Aescleal28-May-12 5:22
Aescleal28-May-12 5:22 
GeneralRe: problem with tamplate deque Pin
a1_shay28-May-12 18:32
a1_shay28-May-12 18:32 
QuestionRe: problem with tamplate deque Pin
David Crow28-May-12 16:58
David Crow28-May-12 16:58 
QuestionHow to integrate cxxTest with Visual Studio IDE Pin
rajKR1227-May-12 19:14
rajKR1227-May-12 19:14 
AnswerRe: How to integrate cxxTest with Visual Studio IDE Pin
Aescleal28-May-12 5:25
Aescleal28-May-12 5:25 
GeneralRe: How to integrate cxxTest with Visual Studio IDE Pin
rajKR125-Jun-12 19:03
rajKR125-Jun-12 19:03 
QuestionCross Platform Development Pin
AmbiguousName27-May-12 0:49
AmbiguousName27-May-12 0:49 

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.