You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
My application will need 3 views in the client area of the main frame. A thin vertical view (view 1) on the left side of the client area. A thin horizontal view (view 2) on the bottom of the client area. And a main view (view 3) in the remainder of the client area. View 1 contains something like "line labels" for view 3. View3 is the height of the client area minus the height of view 2 and is as wide as the client area minus the width of view 1. Therefore the bottom left corner of the main frame client area has no view covering it. View 1 height is the same as view 3 height, and view 2 is only as wide as view 3 width.
I need to have horizontal and vertical scroll bars to scroll the views. These scroll bars need to be independent of the views and child windows of the main frame window. The vertical scroll bar should only be as high as view 3 height and the horizontal scroll bar should only be as wide as view 2. when the vertical scroll bar is scrolled, view 1 and 3 scroll vertically and stay synchronized. When the horizontal scroll bar scrolls, view 2 and 3 horizontally and stay synchronized.
Ivor's book goes over how to add controls to dialog windows, but nothing about adding anything to the main frame window.
Also, when adding things to dialog boxes, you can create an IDC_ id name in the properties window of the object or control and I guess the visual studio IDE assignes a value to it. When I tried to define a CScrollBar class as a member of CMainFrame and then m_HScrollBar.Create the scrollbar, I have to give it an IDC_. Where do I get an IDC_ to use and then message map it?
This is an SDI application using MFC native. It will never run on anything but windows, so it does not need the portability and I am converting the application from VB6. When I tried VB.NET, running with MSIL is frustratingly slow.
This book also need to address mixed native and .NET applications. Areas of the program that need the speed need to be native, but most dialog boxes could use .NET.