Click here to Skip to main content
15,905,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: _variant_t to CStringArray Pin
Stuart Dootson1-Jul-09 2:34
professionalStuart Dootson1-Jul-09 2:34 
QuestionHow to install windows updates WUA api Pin
ashish8patil30-Jun-09 21:11
ashish8patil30-Jun-09 21:11 
AnswerRe: How to install windows updates WUA api Pin
Stuart Dootson30-Jun-09 22:09
professionalStuart Dootson30-Jun-09 22:09 
GeneralRe: How to install windows updates WUA api Pin
ashish8patil30-Jun-09 22:47
ashish8patil30-Jun-09 22:47 
GeneralRe: How to install windows updates WUA api Pin
Stuart Dootson30-Jun-09 22:55
professionalStuart Dootson30-Jun-09 22:55 
QuestionMerge sort for files (C++ realization) Pin
alikalik30-Jun-09 21:05
alikalik30-Jun-09 21:05 
QuestionRe: Merge sort for files (C++ realization) Pin
CPallini30-Jun-09 21:16
mveCPallini30-Jun-09 21:16 
AnswerRe: Merge sort for files (C++ realization) Pin
KarstenK30-Jun-09 21:34
mveKarstenK30-Jun-09 21:34 
AnswerRe: Merge sort for files (C++ realization) Pin
Stuart Dootson30-Jun-09 21:42
professionalStuart Dootson30-Jun-09 21:42 
AnswerRe: Merge sort for files (C++ realization) Pin
Chandrasekharan P30-Jun-09 23:47
Chandrasekharan P30-Jun-09 23:47 
QuestionRe: Merge sort for files (C++ realization) Pin
David Crow1-Jul-09 3:04
David Crow1-Jul-09 3:04 
Questiongenetic algorithm(G A) Pin
luckykhan30-Jun-09 20:59
luckykhan30-Jun-09 20:59 
AnswerRe: genetic algorithm(G A) Pin
Cedric Moonen30-Jun-09 21:07
Cedric Moonen30-Jun-09 21:07 
AnswerRe: genetic algorithm(G A) Pin
Rajesh R Subramanian30-Jun-09 22:58
professionalRajesh R Subramanian30-Jun-09 22:58 
JokeRe: genetic algorithm(G A) Pin
David Crow1-Jul-09 3:07
David Crow1-Jul-09 3:07 
Questionrunning a application as service Pin
rahuljin30-Jun-09 20:40
rahuljin30-Jun-09 20:40 
AnswerRe: running a application as service Pin
Madhu Nair30-Jun-09 20:46
Madhu Nair30-Jun-09 20:46 
GeneralRe: running a application as service Pin
Harsh Shankar30-Jun-09 21:00
Harsh Shankar30-Jun-09 21:00 
AnswerRe: running a application as service Pin
Michael Dunn30-Jun-09 20:47
sitebuilderMichael Dunn30-Jun-09 20:47 
AnswerRe: running a application as service Pin
David Crow1-Jul-09 3:13
David Crow1-Jul-09 3:13 
QuestionError "aggregate'main():: record r' has incomplete type and cannot be defined". ??? Pin
Razanust30-Jun-09 19:37
Razanust30-Jun-09 19:37 
AnswerRe: Error "aggregate'main():: record r' has incomplete type and cannot be defined". ??? Pin
Madhu Nair30-Jun-09 19:43
Madhu Nair30-Jun-09 19:43 
AnswerRe: Error "aggregate'main():: record r' has incomplete type and cannot be defined". ??? Pin
chandu00430-Jun-09 19:44
chandu00430-Jun-09 19:44 
AnswerRe: Error "aggregate'main():: record r' has incomplete type and cannot be defined". ??? Pin
David Crow1-Jul-09 3:39
David Crow1-Jul-09 3:39 
Question880410 - CtlColor Pin
ilostmyid230-Jun-09 19:25
professionalilostmyid230-Jun-09 19:25 
hi i need an edit ctrl for entering numerical values. sometimes these values must lie in a specified range. otherwise, i want to warn the user by changing the edit-box color.
i derived a class from CEdit for this purpose and tried to put the code in the CtlColor:
HBRUSH MyEdit::CtlColor(CDC* pDC, UINT nCtlColor)
{
	if (d_chars==decimalChars)  // if mode==emDecimal
	{
		CString s;
		GetWindowText(s);
		USES_CONVERSION;
		int val=atoi(T2A(s));
		if (val<d_minVal || val>d_maxVal)
		{
			pDC->SetTextColor(RED);
			pDC->SetBkColor(YELLOW);
		}
	}
	return NULL;
}

i don't need to change the default brush used for painting the ctrl, so i return NULL. but this doesn't work. i tried returning a valid handle to a brush i created, but i could at most change the background color, not the text color.
what's the problem?
what's the best solution?
thx

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.