Click here to Skip to main content
16,010,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPrinter driver installation debugging Pin
loneadam200018-Nov-05 1:59
loneadam200018-Nov-05 1:59 
AnswerRe: Printer driver installation debugging Pin
Axter18-Nov-05 19:06
professionalAxter18-Nov-05 19:06 
AnswerRe: Printer driver installation debugging Pin
loneadam200020-Nov-05 20:05
loneadam200020-Nov-05 20:05 
QuestionHow to get the style from another class?? Pin
zxc8917-Nov-05 23:15
zxc8917-Nov-05 23:15 
AnswerRe: How to get the style from another class?? Pin
Cedric Moonen18-Nov-05 1:05
Cedric Moonen18-Nov-05 1:05 
QuestionFlickering... Pin
Raza568017-Nov-05 22:09
Raza568017-Nov-05 22:09 
AnswerRe: Flickering... Pin
kakan17-Nov-05 22:45
professionalkakan17-Nov-05 22:45 
AnswerRe: Flickering... Pin
Owner drawn17-Nov-05 22:47
Owner drawn17-Nov-05 22:47 
Try using double buffering by drawing directly into memory.

After you finish drawing into memory you can transfer the contents of memdc back to your drawing area.

For this you will have to follow the following steps:
Just a sample...
//your dc
CDC dc;
dc.Attach(this->GetDC()->m_hDC);
//memory dc for double buffering
CDC memDC;
//make it compatible
memDC.CreateCompatibleDC(&dc);
//memory bitmap
CBitmap memBmp;
//make this bitmap compatible with your dc
memBmp.CreateCompatibleBitmap(&dc, 100, 100);
//select the bitmap into memory, this should be done as
//you will drawing into this bitmap in memory
CBitmap *oldBmp = memDC.SelectObject(&memBmp);

//now start drawing into memdc
//do all your drawing here.......
//For example memdc.Rectangle(10,10,100,100);
//etc

//after you finish drawing do this
//this will transfer memDC contents onto your window drawing area.
dc.BitBlt(0, 0, 100, 100, &memDC, 0, 0, SRCCOPY);

//clean up required
memDC.SelectObject(oldBmp);
dc.Detach();
//done


This is just a sample of double buffering. This will prevent flickering.

Happy programming Smile | :)


<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord


Questionuse IShellFolder2 then &quot;use of undefined type 'IShellFolder2'&quot; Pin
Blue-Bird17-Nov-05 22:00
Blue-Bird17-Nov-05 22:00 
AnswerRe: use IShellFolder2 then &amp;quot;use of undefined type 'IShellFolder2'&amp;quot; Pin
Sheng Jiang 蒋晟18-Nov-05 11:07
Sheng Jiang 蒋晟18-Nov-05 11:07 
QuestionIs it possible to use GDI+ in VC++ 6.0 Pin
maharaja pandian17-Nov-05 21:44
maharaja pandian17-Nov-05 21:44 
AnswerRe: Is it possible to use GDI+ in VC++ 6.0 Pin
kakan17-Nov-05 22:37
professionalkakan17-Nov-05 22:37 
AnswerRe: Is it possible to use GDI+ in VC++ 6.0 Pin
ThatsAlok17-Nov-05 22:44
ThatsAlok17-Nov-05 22:44 
QuestionCClockST Ver1.3 Pin
benny_t5117-Nov-05 21:41
benny_t5117-Nov-05 21:41 
AnswerRe: CClockST Ver1.3 Pin
toxcct17-Nov-05 23:49
toxcct17-Nov-05 23:49 
Questionhow to print a .bmp or .png file in dialog based applicatio Pin
cancerion17-Nov-05 21:20
cancerion17-Nov-05 21:20 
QuestionHow to open file in own program? Pin
uus9917-Nov-05 21:13
uus9917-Nov-05 21:13 
AnswerRe: How to open file in own program? Pin
cancerion17-Nov-05 21:22
cancerion17-Nov-05 21:22 
AnswerRe: How to open file in own program? Pin
ThatsAlok17-Nov-05 22:07
ThatsAlok17-Nov-05 22:07 
GeneralRe: How to open file in own program? Pin
uus9917-Nov-05 22:42
uus9917-Nov-05 22:42 
GeneralRe: How to open file in own program? Pin
ThatsAlok17-Nov-05 22:56
ThatsAlok17-Nov-05 22:56 
GeneralRe: How to open file in own program? Pin
Cedric Moonen18-Nov-05 0:56
Cedric Moonen18-Nov-05 0:56 
GeneralRe: How to open file in own program? Pin
uus9918-Nov-05 21:03
uus9918-Nov-05 21:03 
AnswerRe: How to open file in own program? Pin
David Crow18-Nov-05 4:10
David Crow18-Nov-05 4:10 
QuestionPLease advice not complext SCHEME drawing control ? Pin
vgrigor117-Nov-05 20:53
vgrigor117-Nov-05 20:53 

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.