Click here to Skip to main content
15,917,328 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioncross platform tcp c program Pin
praveenvelu15-Apr-15 18:05
praveenvelu15-Apr-15 18:05 
AnswerRe: cross platform tcp c program Pin
Richard MacCutchan15-Apr-15 21:40
mveRichard MacCutchan15-Apr-15 21:40 
AnswerRe: cross platform tcp c program Pin
Albert Holguin16-Apr-15 8:25
professionalAlbert Holguin16-Apr-15 8:25 
QuestionCAsyncSockets Blocking/Non blockung Pin
ForNow15-Apr-15 15:41
ForNow15-Apr-15 15:41 
AnswerRe: CAsyncSockets Blocking/Non blockung Pin
Richard MacCutchan15-Apr-15 21:39
mveRichard MacCutchan15-Apr-15 21:39 
GeneralRe: CAsyncSockets Blocking/Non blockung Pin
ForNow16-Apr-15 10:38
ForNow16-Apr-15 10:38 
QuestionInitialisation of a Structure, Can anyone see the Obvious? Pin
Bram van Kampen15-Apr-15 14:59
Bram van Kampen15-Apr-15 14:59 
AnswerRe: Initialisation of a Structure, Can anyone see the Obvious? Pin
Richard MacCutchan15-Apr-15 21:37
mveRichard MacCutchan15-Apr-15 21:37 
GeneralRe: Initialisation of a Structure, Can anyone see the Obvious? Pin
Bram van Kampen26-Apr-15 14:39
Bram van Kampen26-Apr-15 14:39 
AnswerRe: Initialisation of a Structure, Can anyone see the Obvious? Pin
bling17-Apr-15 9:49
bling17-Apr-15 9:49 
GeneralRe: Initialisation of a Structure, Can anyone see the Obvious? Pin
Bram van Kampen26-Apr-15 14:31
Bram van Kampen26-Apr-15 14:31 
QuestionBuild errors ! Pin
Member 935023715-Apr-15 3:01
Member 935023715-Apr-15 3:01 
SuggestionRe: Build errors ! Pin
David Crow15-Apr-15 3:06
David Crow15-Apr-15 3:06 
GeneralRe: Build errors ! Pin
Member 935023715-Apr-15 3:16
Member 935023715-Apr-15 3:16 
GeneralRe: Build errors ! Pin
Richard Andrew x6415-Apr-15 5:48
professionalRichard Andrew x6415-Apr-15 5:48 
GeneralRe: Build errors ! Pin
Member 935023715-Apr-15 6:04
Member 935023715-Apr-15 6:04 
QuestionRe: Build errors ! Pin
David Crow15-Apr-15 6:54
David Crow15-Apr-15 6:54 
GeneralRe: Build errors ! Pin
David Crow15-Apr-15 6:51
David Crow15-Apr-15 6:51 
GeneralRe: Build errors ! Pin
Brisingr Aerowing15-Apr-15 11:22
professionalBrisingr Aerowing15-Apr-15 11:22 
SuggestionRe: Build errors ! Pin
Richard MacCutchan15-Apr-15 7:19
mveRichard MacCutchan15-Apr-15 7:19 
QuestionMFC: flickering issue with GDI+ Pin
Member 1128851411-Apr-15 20:27
Member 1128851411-Apr-15 20:27 
I create a sample dialog application which has a circle drawn. Also on mouse move the circle will be re-drawn. I am providing my code below. Its also compilable.

I tried using double buffering and erasebackground, i was not getting the flickering issue, but i observed that the drawining is not erased properly. So to erase, in OnPaint i wrote the erasing code. Again i am facing the flickering issue.

CPaintDC dc(this);
GetClientRect(&clientRect);
circle = clientRect;
circle.DeflateRect(100,100);
dc.SelectStockObject(NULL_BRUSH);
dc.SelectStockObject(NULL_PEN);
dc.FillSolidRect(circle, ::GetSysColor(COLOR_BTNFACE));

Bitmap buffer(circle.right, circle.bottom);
Graphics graphicsbuf(&buffer);
Graphics graphics(dc.m_hDC);
graphicsbuf.SetSmoothingMode(SmoothingModeHighQuality);

SolidBrush brush(Color(255,71,71,71));
Pen bluePen(Color(255, 0, 0, 255),1);

graphicsbuf.DrawEllipse(&bluePen,Rect(circle.left,circle.top,circle.Width(),circle.Height()));
graphicsbuf.SetSmoothingMode(SmoothingModeHighQuality);
graphics.DrawImage(&buffer, 0, 0);

}

void CPOCDlg::OnMouseMove(UINT nFlags, CPoint point)
{
m_point = point;
InvalidateRect(circle,FALSE);
CDialogEx::OnMouseMove(nFlags, point);

}

BOOL CPOCDlg::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
Please let me know if i am doing any mistake.
GeneralRe: MFC: flickering issue with GDI+ Pin
David Crow12-Apr-15 16:55
David Crow12-Apr-15 16:55 
GeneralRe: MFC: flickering issue with GDI+ Pin
Stephen Hewitt15-Apr-15 10:41
Stephen Hewitt15-Apr-15 10:41 
QuestionDrawing border to dialog using GDI+ Pin
Member 1128851411-Apr-15 19:30
Member 1128851411-Apr-15 19:30 
AnswerRe: Drawing border to dialog using GDI+ Pin
Richard MacCutchan11-Apr-15 21:24
mveRichard MacCutchan11-Apr-15 21:24 

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.