Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: vc++ related to xml Pin
Cedric Moonen12-May-07 22:01
Cedric Moonen12-May-07 22:01 
GeneralRe: vc++ related to xml Pin
Hans Dietrich13-May-07 0:12
mentorHans Dietrich13-May-07 0:12 
AnswerRe: vc++ related to xml Pin
Hamid_RT13-May-07 1:21
Hamid_RT13-May-07 1:21 
AnswerRe: vc++ related to xml Pin
#realJSOP13-May-07 3:57
professional#realJSOP13-May-07 3:57 
QuestionOne line miss problem Pin
hsuch12-May-07 19:26
hsuch12-May-07 19:26 
QuestionRe: One line miss problem Pin
bob1697212-May-07 20:06
bob1697212-May-07 20:06 
AnswerRe: One line miss problem Pin
hsuch12-May-07 20:49
hsuch12-May-07 20:49 
GeneralRe: One line miss problem Pin
bob1697212-May-07 23:29
bob1697212-May-07 23:29 
When you change the viewport and window extents, you will suffer from "off by one" errors. This is inherent in how non MM_TEXT mapping modes work and the algebra used for the metric translations. Those errors become evident when you apply offscreen buffering techniques such as described by Petzold, Jones, and in Keith Rule's article here on codeproject. His example claims to support MM_ANISOTROPIC but if you examine his source code, you will find he leaves the viewport and window extents at 1 which is effectively the same as MM_TEXT and when applied to the algebraic equations will not cause off by one errors. Obviously, MM_ANISOTROPIC and MM_ISOTROPIC would be useless if used without setting the extents as this is what provides the scaling. (By the way, that's not a bash on the authors as their code helps greatly, just a matter of factly statement)

If you are using a variant of one of the published authors memDC and using MM_ISOTROPIC, this is likely what you are suffering from or will find you are suffering from later.

One way to verify this is to turn on "Show windows contents while dragging" in the display properties/appearance tab/effects button. Drag the help/about box from your application over your client area in random paths and if it "smears" or "smudges" your drawings then you are suffering from this.

It basically involves the calculation of the clipping rectangle and the fact that there is a LPtoDP and a DPtoLP involved explicitly and indirectly by the windows API functions. If your familiar with the "pigeon hole principle" then you already understand the fact that a round trip could cause a loss of data. Hence the off by one error that leaves a single pixel width not refreshed on the edge of the clipping rectangle.

Some people never notice it because they have the "Show windows contents while dragging" turned off so as they resize the window or drag something over it, they only see a tracker rect and not the leftover non refreshed edges. I posted a reply in Keith's article linking to a helpful MSDN article that helped me realize how get past this (somebody didn't like my response there, got a 2 vote probably because I didn't post the code or something). In a nutshell, you need to calculate the rectangle that is used for the bitmap and the blit without any LPtoDP or DPtoLP round trips. here[^]
GeneralRe: One line miss problem Pin
hsuch13-May-07 7:43
hsuch13-May-07 7:43 
QuestionDistinguish Thread State(running or suspend) Pin
A_Fa12-May-07 19:03
A_Fa12-May-07 19:03 
AnswerRe: Distinguish Thread State(running or suspend) Pin
Mark Salsbery13-May-07 6:23
Mark Salsbery13-May-07 6:23 
QuestionVC++ 6.0 and VSS integration registry entries - again Pin
Vaclav_12-May-07 14:04
Vaclav_12-May-07 14:04 
QuestionVisual Styles - Edit Control Pin
Meh!12-May-07 13:44
Meh!12-May-07 13:44 
AnswerRe: Visual Styles - Edit Control Pin
Perspx13-May-07 0:15
Perspx13-May-07 0:15 
QuestionMonitor open files on a share Pin
Vadim Tabakman12-May-07 13:35
Vadim Tabakman12-May-07 13:35 
AnswerRe: Monitor open files on a share Pin
Vadim Tabakman12-May-07 16:47
Vadim Tabakman12-May-07 16:47 
GeneralRe: Monitor open files on a share Pin
erajsri13-May-07 22:32
erajsri13-May-07 22:32 
QuestionCorrect usage of reinterpret_cast and static_cast Pin
ComplexLifeForm12-May-07 10:03
ComplexLifeForm12-May-07 10:03 
AnswerRe: Correct usage of reinterpret_cast and static_cast Pin
John R. Shaw12-May-07 10:58
John R. Shaw12-May-07 10:58 
AnswerRe: Correct usage of reinterpret_cast and static_cast Pin
bob1697212-May-07 12:06
bob1697212-May-07 12:06 
GeneralRe: Correct usage of reinterpret_cast and static_cast Pin
John R. Shaw12-May-07 12:36
John R. Shaw12-May-07 12:36 
GeneralRe: Correct usage of reinterpret_cast and static_cast Pin
bob1697212-May-07 13:20
bob1697212-May-07 13:20 
GeneralRe: Correct usage of reinterpret_cast and static_cast Pin
Stephen Hewitt13-May-07 15:00
Stephen Hewitt13-May-07 15:00 
GeneralRe: Correct usage of reinterpret_cast and static_cast Pin
John R. Shaw14-May-07 15:12
John R. Shaw14-May-07 15:12 
GeneralRe: Correct usage of reinterpret_cast and static_cast Pin
ComplexLifeForm12-May-07 21:11
ComplexLifeForm12-May-07 21:11 

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.