Click here to Skip to main content
16,004,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GUID as parameter "conversion" failure Pin
Richard MacCutchan30-Jul-13 5:44
mveRichard MacCutchan30-Jul-13 5:44 
Generaldraw multiple lines and move then on screen Pin
appollosputnik28-Jul-13 5:13
appollosputnik28-Jul-13 5:13 
GeneralRe: draw multiple lines and move then on screen Pin
Richard MacCutchan28-Jul-13 6:23
mveRichard MacCutchan28-Jul-13 6:23 
GeneralRe: draw multiple lines and move then on screen Pin
appollosputnik28-Jul-13 6:49
appollosputnik28-Jul-13 6:49 
GeneralRe: draw multiple lines and move then on screen Pin
Richard MacCutchan28-Jul-13 7:09
mveRichard MacCutchan28-Jul-13 7:09 
GeneralRe: draw multiple lines and move then on screen Pin
Rajdeep_28-Jul-13 20:21
Rajdeep_28-Jul-13 20:21 
GeneralRe: draw multiple lines and move then on screen Pin
Erudite_Eric29-Jul-13 21:30
Erudite_Eric29-Jul-13 21:30 
GeneralRe: draw multiple lines and move then on screen Pin
leon de boer11-Aug-13 4:26
leon de boer11-Aug-13 4:26 
That is perhaps the most ugliest way to solve the problem and has many horrible disadvantages ... IT IS OLD SCHOOL HORRIBLE DONT DO IT.

Problems you will definitely encounter:

1.) The draw process become slower and slower the more lines you have to draw
2.) As your draw process is contained inside the WM_PAINT message your can't thread it
3.) Your application becomes locked and unresponsive while in the draw process
4.) Every time you resize the window it will redraw all the line database
5.) Every time you move the window order or position it will do an entire redraw

Get an old copy of MS_WORD and open a 1MB image file if you want to see what it looks like.

Old versions of many Cad programs and Corel draw were practically unusable because they used the above technique and we have long since moved on from it.

The correct and more modern way to do this is to create a drawing thread that converts your line database onto a memory DC. That is all the thread does all the time when triggered.

The WM_PAINT message simply puts the last finished memory DC from the thread to screen.

Usually every database alteration is held so you can also undo-redo function it.

The obvious advantages is your program never suffers non responsive or semi locked behavior no matter how complex the drawing gets and the application drawing process does not flash and carry on.

Let me know if you get stuck and I will do a quick stub to show you how it works.

modified 11-Aug-13 11:09am.

Questionwhat is the usage about _Out_opt_bytecapcount_ Pin
yu-jian28-Jul-13 1:00
yu-jian28-Jul-13 1:00 
AnswerRe: what is the usage about _Out_opt_bytecapcount_ Pin
Richard Andrew x6428-Jul-13 8:16
professionalRichard Andrew x6428-Jul-13 8:16 
Questionget the function address from it's name using IMAGE_IMPORT_DESCRIPTOR Pin
JoneLe8627-Jul-13 9:43
JoneLe8627-Jul-13 9:43 
AnswerRe: get the function address from it's name using IMAGE_IMPORT_DESCRIPTOR Pin
pasztorpisti27-Jul-13 9:57
pasztorpisti27-Jul-13 9:57 
GeneralRe: get the function address from it's name using IMAGE_IMPORT_DESCRIPTOR Pin
JoneLe8627-Jul-13 10:00
JoneLe8627-Jul-13 10:00 
GeneralRe: get the function address from it's name using IMAGE_IMPORT_DESCRIPTOR Pin
pasztorpisti27-Jul-13 10:01
pasztorpisti27-Jul-13 10:01 
GeneralRe: get the function address from it's name using IMAGE_IMPORT_DESCRIPTOR Pin
pasztorpisti27-Jul-13 10:03
pasztorpisti27-Jul-13 10:03 
GeneralRe: get the function address from it's name using IMAGE_IMPORT_DESCRIPTOR Pin
Richard Andrew x6427-Jul-13 14:10
professionalRichard Andrew x6427-Jul-13 14:10 
GeneralRe: get the function address from it's name using IMAGE_IMPORT_DESCRIPTOR Pin
pasztorpisti27-Jul-13 14:50
pasztorpisti27-Jul-13 14:50 
QuestionRegisterDeviceNotification in dbt.h undeclared identifier?? Pin
Vaclav_24-Jul-13 12:20
Vaclav_24-Jul-13 12:20 
AnswerRe: RegisterDeviceNotification in dbt.h undeclared identifier?? Pin
Richard Andrew x6424-Jul-13 14:08
professionalRichard Andrew x6424-Jul-13 14:08 
GeneralRe: RegisterDeviceNotification in dbt.h undeclared identifier?? Pin
«_Superman_»24-Jul-13 18:38
professional«_Superman_»24-Jul-13 18:38 
AnswerRe: RegisterDeviceNotification in dbt.h undeclared identifier?? Pin
«_Superman_»24-Jul-13 18:40
professional«_Superman_»24-Jul-13 18:40 
AnswerRe: RegisterDeviceNotification in dbt.h undeclared identifier?? Pin
Richard MacCutchan24-Jul-13 21:24
mveRichard MacCutchan24-Jul-13 21:24 
GeneralRe: RegisterDeviceNotification in dbt.h undeclared identifier?? Pin
Vaclav_25-Jul-13 7:17
Vaclav_25-Jul-13 7:17 
GeneralRe: RegisterDeviceNotification in dbt.h undeclared identifier?? Pin
Jochen Arndt25-Jul-13 7:43
professionalJochen Arndt25-Jul-13 7:43 
GeneralRe: RegisterDeviceNotification in dbt.h undeclared identifier?? SOLVED Pin
Vaclav_26-Jul-13 5:50
Vaclav_26-Jul-13 5:50 

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.