Click here to Skip to main content
16,011,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to add XP themes to a toolbar (toolband?)?! Pin
Steve Thresher12-Dec-03 3:07
Steve Thresher12-Dec-03 3:07 
GeneralRe: How to add XP themes to a toolbar (toolband?)?! Pin
Vermithrax12-Dec-03 4:29
Vermithrax12-Dec-03 4:29 
Questionhow to create a new desktop under win98?? Pin
zhu11-Dec-03 15:54
zhu11-Dec-03 15:54 
AnswerRe: how to create a new desktop under win98?? Pin
Michael Dunn11-Dec-03 17:22
sitebuilderMichael Dunn11-Dec-03 17:22 
GeneralRe: how to create a new desktop under win98?? Pin
zhu11-Dec-03 20:18
zhu11-Dec-03 20:18 
GeneralRe: how to create a new desktop under win98?? Pin
Antti Keskinen12-Dec-03 1:40
Antti Keskinen12-Dec-03 1:40 
GeneralRe: how to create a new desktop under win98?? Pin
Alexander M.,12-Dec-03 2:50
Alexander M.,12-Dec-03 2:50 
Generalcannot invalidaterect Pin
R. Thomas11-Dec-03 15:35
R. Thomas11-Dec-03 15:35 
hi...
i have a problem in invalidating...Frown | :(
below are my codes

void CEditorView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if( lHint == 1 ) {
//get back the rect
CRect* pRect = ( CRect* ) pHint;
InvalidateRect(pRect);
return;
}
CView::OnUpdate(pSender, lHint, pHint);
}
which are taken from the OnUpdate handler of my View..
the way OnUpdate is called from my DOC is as below :
void CEditorDoc::SetSquareColor(int i, int j, COLORREF color)
{
ASSERT( i >= 0 && i <= GetGridY() && j >= 0 && j <= GetGridX() );
m_clrGrid.At(i, j) = color;
SetModifiedFlag(TRUE);
CRect pRect( 20, -10, 30, -20 );
UpdateAllViews( NULL, 1, ( CObject* )&pRect);
}

THE PROBLEM
the problem arrives when i do InvalidateRect, the rect passed in as parameter is bnot getting invalidated!!
Now, to check if my parameter is wrong i added code in the OnUpdate to draw a rectangle with the same coordinates.
so now the same code above becomes :

void CEditorView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if( lHint == 1 ) {
//get back the rect
CRect* pRect = ( CRect* ) pHint;
InvalidateRect(pRect);

CBrush brush(RGB(255,166,166));
CBrush* pOldBrush = dc.SelectObject(&brush);

CRect jrtRect(20, -10, 30, -20);
dc.Rectangle(jrtRect);
dc.SelectObject(pOldBrush);
Invalidate();
return;
}
CView::OnUpdate(pSender, lHint, pHint);
}

what i found out that with the above code, a rectange is drawn in the correct place where i wanted to invalidate the rect!!!
but the rectangle apprears and quickly dissapears!!Frown | :(
so now i know that the co-ordinates i supplied witht the invalidateRect were correct...
then why doesnt the area get Invalidated??Frown | :(
any help is deeply appreciated and thank you for your time...

Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40

GeneralSorting Strings In a ListBox win32 Pin
Member 45722511-Dec-03 15:10
Member 45722511-Dec-03 15:10 
GeneralRe: Sorting Strings In a ListBox win32 Pin
l a u r e n11-Dec-03 20:32
l a u r e n11-Dec-03 20:32 
GeneralRe: Sorting Strings In a ListBox win32 Pin
Big Art12-Dec-03 7:56
Big Art12-Dec-03 7:56 
GeneralRe: Sorting Strings In a ListBox win32 Pin
Member 45722512-Dec-03 8:32
Member 45722512-Dec-03 8:32 
GeneralRe: Sorting Strings In a ListBox win32 Pin
Member 45722512-Dec-03 8:43
Member 45722512-Dec-03 8:43 
GeneralRe: Sorting Strings In a ListBox win32 Pin
Big Art12-Dec-03 12:48
Big Art12-Dec-03 12:48 
GeneralRe: Sorting Strings In a ListBox win32 Pin
Big Art12-Dec-03 13:02
Big Art12-Dec-03 13:02 
GeneralRe: Sorting Strings In a ListBox win32 Pin
Member 45722513-Dec-03 6:23
Member 45722513-Dec-03 6:23 
GeneralRe: Sorting Strings In a ListBox win32 Pin
Member 45722513-Dec-03 6:36
Member 45722513-Dec-03 6:36 
GeneralConvert VC++ project to Borland free compiler Pin
alex.barylski11-Dec-03 15:09
alex.barylski11-Dec-03 15:09 
GeneralRe: Convert VC++ project to Borland free compiler Pin
Joe Woodbury11-Dec-03 17:32
professionalJoe Woodbury11-Dec-03 17:32 
GeneralWho knows how to get character matrix in win and dos! Please help! Pin
twing11-Dec-03 14:56
twing11-Dec-03 14:56 
GeneralRe: Who knows how to get character matrix in win and dos! Please help! Pin
Anthony_Yio11-Dec-03 22:25
Anthony_Yio11-Dec-03 22:25 
QuestionIn VC6.0, how to change Release to Debug? Pin
zhaopzhi11-Dec-03 14:05
zhaopzhi11-Dec-03 14:05 
AnswerRe: In VC6.0, how to change Release to Debug? Pin
Michael Dunn11-Dec-03 14:45
sitebuilderMichael Dunn11-Dec-03 14:45 
GeneralRe: In VC6.0, how to change Release to Debug? Pin
Shay Harel12-Dec-03 6:51
Shay Harel12-Dec-03 6:51 
AnswerRe: In VC6.0, how to change Release to Debug? Pin
Anthony_Yio11-Dec-03 22:19
Anthony_Yio11-Dec-03 22:19 

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.