Click here to Skip to main content
15,910,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: USES_CONVERSION Pin
Mihai Filimon4-Apr-03 2:45
Mihai Filimon4-Apr-03 2:45 
Generalsilly netscape Pin
includeh104-Apr-03 0:43
includeh104-Apr-03 0:43 
GeneralRe: silly netscape Pin
Dominik Reichl4-Apr-03 0:47
Dominik Reichl4-Apr-03 0:47 
QuestionHow to add text at the end of a file? Pin
julych4-Apr-03 0:21
julych4-Apr-03 0:21 
AnswerRe: How to add text at the end of a file? Pin
Roger Allen4-Apr-03 0:26
Roger Allen4-Apr-03 0:26 
GeneralDialog losing focus Pin
Ricky_TheBard4-Apr-03 0:17
Ricky_TheBard4-Apr-03 0:17 
GeneralRe: Dialog losing focus Pin
Dominik Reichl4-Apr-03 0:43
Dominik Reichl4-Apr-03 0:43 
GeneralCFileDialog in CPropertyPage Pin
Wim Jans4-Apr-03 0:17
Wim Jans4-Apr-03 0:17 
GeneralRe: CFileDialog in CPropertyPage Pin
Mike Upton4-Apr-03 2:13
Mike Upton4-Apr-03 2:13 
GeneralRe: CFileDialog in CPropertyPage Pin
Joan M4-Apr-03 2:48
professionalJoan M4-Apr-03 2:48 
GeneralADO and Complex WHERE clause Pin
Anonymous3-Apr-03 23:43
Anonymous3-Apr-03 23:43 
GeneralRe: ADO and Complex WHERE clause Pin
Pavel Klocek4-Apr-03 0:54
Pavel Klocek4-Apr-03 0:54 
GeneralRe: ADO and Complex WHERE clause Pin
Anonymous4-Apr-03 1:50
Anonymous4-Apr-03 1:50 
GeneralRe: ADO and Complex WHERE clause Pin
Gunnar Bolle4-Apr-03 2:24
Gunnar Bolle4-Apr-03 2:24 
GeneralRe: ADO and Complex WHERE clause Pin
RChin4-Apr-03 2:32
RChin4-Apr-03 2:32 
GeneralAdvanced CTreeCtrl Pin
JensB3-Apr-03 23:12
JensB3-Apr-03 23:12 
QuestionEntry Point Not Found???? Pin
jerry0davis3-Apr-03 22:56
jerry0davis3-Apr-03 22:56 
AnswerRe: Entry Point Not Found???? Pin
RobJones4-Apr-03 2:46
RobJones4-Apr-03 2:46 
GeneralCHtmlView & ScrollBar Pin
jeremysay3-Apr-03 22:09
jeremysay3-Apr-03 22:09 
GeneralRe: CHtmlView & ScrollBar Pin
Mike Upton3-Apr-03 22:31
Mike Upton3-Apr-03 22:31 
I think the problem is that m_hScroll isn't actually the scroll-bar that you see in the window. When you set the style (cs.style() in PreCreateWindow to WS_VSCROLL | WS_HSCROLL the window creates its own scrollbars, and you need to use the member functions of CWnd to access them.

For example, to get and set the position of the horizontal scroll-bar
void CChildFrame::some_function(int sb_pos)
{
    //Setting the horizontal scroll position
    SetScrollPos(SB_HORZ, sb_pos, TRUE);
    //Getting the horizontal scroll position
    int current_pos = GetScrollPos(SB_HORZ);
    ASSERT(current_pos==sb_pos);
}


You'll also need to change your OnCreate function:
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    SetScrollRange(SB_HORZ, 0, 50,TRUE);
    SetScrollPos(SB_HORZ, 0,TRUE);
}

And take out the m_hScroll from your window.

Hope that helps (and I hope it's right too!)



"We are the knights who say Ni" (The Knights Who Say Ni)
GeneralRe: CHtmlView & ScrollBar Pin
jeremysay4-Apr-03 1:00
jeremysay4-Apr-03 1:00 
GeneralDirectDraw: blitting between 2 differents pixels formats surfaces... Pin
Raphael Kindt3-Apr-03 22:01
Raphael Kindt3-Apr-03 22:01 
QuestionHow can I know explorer band's events??? Pin
Jun-ha Park3-Apr-03 21:56
Jun-ha Park3-Apr-03 21:56 
GeneralAlpha Blending in MFC image list Pin
Ceri3-Apr-03 21:46
Ceri3-Apr-03 21:46 
GeneralWhy,Why,Why no one can resolvoe this Question?Doc/view/frame!I Have post this artical 5 time! Pin
zhangyifei3-Apr-03 21:01
zhangyifei3-Apr-03 21:01 

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.