Click here to Skip to main content
15,909,822 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: managed code strange behaviour.. Pin
led mike23-Sep-08 4:22
led mike23-Sep-08 4:22 
GeneralRe: managed code strange behaviour.. Pin
montiee24-Sep-08 1:58
montiee24-Sep-08 1:58 
QuestionCDateTimeCtrl Pin
john563223-Sep-08 3:03
john563223-Sep-08 3:03 
AnswerRe: CDateTimeCtrl Pin
David Crow23-Sep-08 3:12
David Crow23-Sep-08 3:12 
QuestionRe: CDateTimeCtrl Pin
CPallini23-Sep-08 3:15
mveCPallini23-Sep-08 3:15 
AnswerRe: CDateTimeCtrl Pin
john563223-Sep-08 4:30
john563223-Sep-08 4:30 
GeneralRe: CDateTimeCtrl Pin
David Crow23-Sep-08 5:47
David Crow23-Sep-08 5:47 
QuestionCTreeCtrl strange behaviour Pin
bhanu_850923-Sep-08 2:31
bhanu_850923-Sep-08 2:31 
Dear All,

I am experiencing a strange problem using CTreeCtrl. I have a dialog in which I have changed the background colour to black using OnCtlColor method.

After that, I have placed a CTreeCtrl and set the properties "HasLines", "HasButtons" and "LinesAtRoot" to true. When I run the program to show the dialog I got Debug Assertion error and when I debug it shows error on the DoDataExhange method and sometimes on the dlgdata.cpp.

But when I change the properties to false there is no debug assertion error. Also, if I didn't change the background using the OnCtlColor and set the properties "HasLines", "HasButtons" and "LinesAtRoot" to true it works fine.

I am very confused with this behaviour. I need background color black for the dialog and want the properties to set TRUE. Please help me to sort out this issue.

Many thanks in advance.

Code snippet for OnCtlColor
HBRUSH MuxInfo::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	
	UpdateData(TRUE);

	if (pWnd->GetDlgCtrlID() )//== IDC_ALLMSG) //|| pWnd->GetDlgCtrlID() == IDC_MESSAGE)
	{
		// either the listbox or edit box has input focus

		if (m_bFirstTime == TRUE) // First time through function... set up default color
			pDC->SetTextColor(RGB(0,0,0));
		else
		{
			pDC->SetTextColor(RGB(GetRValue(m_crColor),GetGValue(m_crColor),
				GetBValue(m_crColor)));
			pDC->SetBkColor(RGB(255 - GetRValue(m_crColor),
				255 - GetGValue(m_crColor), 255 - GetBValue(m_crColor)));
		}
	}

	return m_brush; // Paint the dialog black!!
	
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

AnswerRe: CTreeCtrl strange behaviour Pin
SandipG 23-Sep-08 2:41
SandipG 23-Sep-08 2:41 
QuestionProblem in getting hash values [modified] Pin
Aryan S23-Sep-08 2:22
Aryan S23-Sep-08 2:22 
QuestionMulticolumn CComboBox? Pin
bosfan23-Sep-08 1:37
bosfan23-Sep-08 1:37 
AnswerRe: Multicolumn CComboBox? Pin
Rajesh R Subramanian23-Sep-08 1:48
professionalRajesh R Subramanian23-Sep-08 1:48 
GeneralRe: Multicolumn CComboBox? Pin
bosfan23-Sep-08 2:03
bosfan23-Sep-08 2:03 
QuestionRasDial() howto Pin
eusto23-Sep-08 1:28
eusto23-Sep-08 1:28 
QuestionRe: RasDial() howto Pin
David Crow23-Sep-08 3:17
David Crow23-Sep-08 3:17 
AnswerRe: RasDial() howto Pin
eusto23-Sep-08 3:34
eusto23-Sep-08 3:34 
QuestionRe: RasDial() howto Pin
David Crow23-Sep-08 3:40
David Crow23-Sep-08 3:40 
AnswerRe: RasDial() howto Pin
eusto23-Sep-08 4:38
eusto23-Sep-08 4:38 
GeneralRe: RasDial() howto Pin
David Crow23-Sep-08 4:46
David Crow23-Sep-08 4:46 
GeneralRe: RasDial() howto Pin
eusto23-Sep-08 4:57
eusto23-Sep-08 4:57 
Questionchange Static text font size Pin
Dhiraj kumar Saini23-Sep-08 0:13
Dhiraj kumar Saini23-Sep-08 0:13 
AnswerRe: change Static text font size Pin
KarstenK23-Sep-08 0:28
mveKarstenK23-Sep-08 0:28 
Questionside by side configration error Pin
VCProgrammer22-Sep-08 23:55
VCProgrammer22-Sep-08 23:55 
AnswerRe: side by side configration error Pin
toxcct23-Sep-08 0:03
toxcct23-Sep-08 0:03 
GeneralRe: side by side configration error Pin
VCProgrammer23-Sep-08 0:07
VCProgrammer23-Sep-08 0:07 

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.