Click here to Skip to main content
15,905,616 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: character set conversion(UTF8 and UCS2) Pin
convert_sg21-Oct-03 19:03
convert_sg21-Oct-03 19:03 
Questionhow can i reach the same result in vc++? Pin
Habbit21-Oct-03 16:31
Habbit21-Oct-03 16:31 
AnswerRe: how can i reach the same result in vc++? Pin
David Crow21-Oct-03 16:51
David Crow21-Oct-03 16:51 
Generalthanks Pin
Habbit21-Oct-03 16:55
Habbit21-Oct-03 16:55 
GeneralRe: how can i reach the same result in vc++? Pin
includeh1022-Oct-03 4:49
includeh1022-Oct-03 4:49 
GeneralRe: how can i reach the same result in vc++? Pin
David Crow22-Oct-03 5:10
David Crow22-Oct-03 5:10 
GeneralDisable Auto Bitmap Scroll in CScrollView Pin
Swinefeaster21-Oct-03 15:45
Swinefeaster21-Oct-03 15:45 
GeneralRe: Disable Auto Bitmap Scroll in CScrollView Pin
John R. Shaw22-Oct-03 3:53
John R. Shaw22-Oct-03 3:53 
The behavior you are describing is what CScrollView was designed to do.
Why would you want to disable this behavior?

May be the following will help you figure out what the problem is:

When you click the scrollbar in a CSrollView based window it is scrolled automaticaly for you and DC origin is changed to the new possition. You then receive a WM_PAINT message (OnDraw()) to update (draw) the invalid portion of the window.

Before scroll:

origin of DC and Window -> (0,0) +-------------------+
                                 |                   |
                                 |                   |
                                 |                   |
                                 |                   |
                        (0, 100) +-------------------+

After scroll:
           origin of DC -> (0,-N) +-------------------+
                                  |                   |
       origin of window -> (0, 0) +-------------------+ <- DC (0, N)
                                  |                   |
                                  |                   |
                   DC -> (0, 100) |-------------------|
                                  | Invalid rect.     | <- needs redrawing
               window -> (0, 100) +-------------------+ <- DC (0, 100 + N)


If you do any drawing to the window outside of OnDraw() then you will need get the origin of the drawing DC so that you know where to draw. I usualy just use the scroll positions:
Origin.x = -GetScrollPos(SB_HORZ);
Origin.y = -GetScrollPos(SB_VERT);

Smile | :) I hope this helps!

INTP
GeneralRe: Disable Auto Bitmap Scroll in CScrollView Pin
Swinefeaster22-Oct-03 7:15
Swinefeaster22-Oct-03 7:15 
GeneralEXCEPTION_ACCESS_VIOLATION Pin
John R. Shaw21-Oct-03 15:05
John R. Shaw21-Oct-03 15:05 
GeneralOpenGL in SDI/MDI tutorial Pin
ferryc@cbn.net.id21-Oct-03 14:37
ferryc@cbn.net.id21-Oct-03 14:37 
GeneralRe: OpenGL in SDI/MDI tutorial Pin
Snyp21-Oct-03 14:48
Snyp21-Oct-03 14:48 
GeneralRe: OpenGL in SDI/MDI tutorial Pin
Snyp21-Oct-03 14:53
Snyp21-Oct-03 14:53 
GeneralHelp in console c++ Pin
Snyp21-Oct-03 13:39
Snyp21-Oct-03 13:39 
GeneralRe: Help in console c++ Pin
Christian Graus21-Oct-03 13:49
protectorChristian Graus21-Oct-03 13:49 
GeneralRe: Help in console c++ Pin
Snyp21-Oct-03 13:51
Snyp21-Oct-03 13:51 
GeneralRe: Help in console c++ Pin
Christian Graus21-Oct-03 13:52
protectorChristian Graus21-Oct-03 13:52 
GeneralRe: Help in console c++ Pin
Snyp21-Oct-03 14:17
Snyp21-Oct-03 14:17 
GeneralRe: Help in console c++ Pin
Christian Graus21-Oct-03 14:18
protectorChristian Graus21-Oct-03 14:18 
GeneralRe: Help in console c++ Pin
Snyp21-Oct-03 14:21
Snyp21-Oct-03 14:21 
GeneralRe: Help in console c++ Pin
Christian Graus21-Oct-03 14:25
protectorChristian Graus21-Oct-03 14:25 
GeneralRe: Help in console c++ Pin
Snyp21-Oct-03 14:46
Snyp21-Oct-03 14:46 
GeneralRe: Help in console c++ Pin
joshfl23-Oct-03 10:02
joshfl23-Oct-03 10:02 
QuestionWhy wont this compile? Pin
adonisv21-Oct-03 11:32
adonisv21-Oct-03 11:32 
AnswerRe: Why wont this compile? Pin
Kentamanos21-Oct-03 11:51
Kentamanos21-Oct-03 11:51 

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.