Click here to Skip to main content
16,016,693 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWaitable Timers Pin
bmw50023-Sep-04 20:06
bmw50023-Sep-04 20:06 
GeneralDataGrid Control problem Pin
Imtiaz Murtaza3-Sep-04 20:04
Imtiaz Murtaza3-Sep-04 20:04 
GeneralAlgorithm for CTime in CTimeSpan Pin
anderslundsgard3-Sep-04 19:59
anderslundsgard3-Sep-04 19:59 
GeneralRe: Algorithm for CTime in CTimeSpan Pin
Ravi Bhavnani3-Sep-04 20:18
professionalRavi Bhavnani3-Sep-04 20:18 
GeneralRe: Algorithm for CTime in CTimeSpan Pin
Jörgen Sigvardsson4-Sep-04 1:54
Jörgen Sigvardsson4-Sep-04 1:54 
GeneralRe: Algorithm for CTime in CTimeSpan Pin
anderslundsgard5-Sep-04 23:31
anderslundsgard5-Sep-04 23:31 
GeneralAlt+Tab, Application Icon Hidding Pin
swarup3-Sep-04 18:18
swarup3-Sep-04 18:18 
GeneralScrollView problem Pin
coolecho3-Sep-04 18:04
coolecho3-Sep-04 18:04 
Hi,

I created an SDI scrollview app, and the text displays OK initially. However when it is scrolled down and then back up the text doesn't get restored properly. Also if the app is covered up and then restored the window is blank. Most of the work is done in OnInitialUpdate and OnDraw.

void CViewDocView::OnDraw(CDC* pDC)
{
UINT status;
CViewDocDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
m_nLinesTotal = pDoc->GetDocumentLength();
if (m_nLinesTotal != 0)
{
// Initialize the position of text in the window.
UINT position = 0;
CFont* pOldFont = pDC->SelectObject (&m_fontScreen);
for (UINT i=0; i<=m_nLinesTotal; i++) {
CString string;
status = pDoc->GetLine( string );
pDC->TextOut(2, position, string);
position += m_cyScreen;
}
pDC->SelectObject (pOldFont);
}
}
void CViewDocView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CViewDocDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
SetScrollSizes (MM_TEXT, CSize (0, pDoc->GetDocumentLength() * m_cyScreen),
CSize (0, m_cyScreen * 10), CSize (0, m_cyScreen));
ScrollToPosition (CPoint (0, 0));
}
The font is set up in OnCreate() and the font height from GetTextMetrics() is assigned to m_cyScreen.

Thanks in advance
GeneralCListCtrl sorting issue... Pin
IQ03-Sep-04 13:45
IQ03-Sep-04 13:45 
GeneralVisual C++ Express 2005 Pin
holland3-Sep-04 10:55
holland3-Sep-04 10:55 
GeneralRe: Visual C++ Express 2005 Pin
Jörgen Sigvardsson4-Sep-04 11:15
Jörgen Sigvardsson4-Sep-04 11:15 
GeneralProcess Information Pin
Ivan Cachicatari3-Sep-04 10:37
Ivan Cachicatari3-Sep-04 10:37 
GeneralRe: Process Information Pin
lesnikowski3-Sep-04 10:52
lesnikowski3-Sep-04 10:52 
GeneralVideo &amp; audio Pin
Andre Massada3-Sep-04 8:56
Andre Massada3-Sep-04 8:56 
GeneralRe: Video & audio Pin
TheBlindWatchmaker3-Sep-04 10:27
TheBlindWatchmaker3-Sep-04 10:27 
GeneralRe: Video &amp; audio Pin
Andre Massada3-Sep-04 21:21
Andre Massada3-Sep-04 21:21 
GeneralCorrect way to copy HBITMAP handle Pin
m_mond3-Sep-04 8:25
m_mond3-Sep-04 8:25 
GeneralRe: Correct way to copy HBITMAP handle Pin
Michael Dunn3-Sep-04 16:18
sitebuilderMichael Dunn3-Sep-04 16:18 
Generalun editable dialoge Pin
Anonymous3-Sep-04 7:49
Anonymous3-Sep-04 7:49 
GeneralRe: un editable dialoge Pin
Maximilien3-Sep-04 8:17
Maximilien3-Sep-04 8:17 
GeneralRe: un editable dialoge Pin
David Crow3-Sep-04 9:45
David Crow3-Sep-04 9:45 
GeneralGDI+ Question Pin
Rassul Yunussov3-Sep-04 7:37
Rassul Yunussov3-Sep-04 7:37 
QuestionHow to get text response from a webpage? Pin
Kajal Shah3-Sep-04 7:09
Kajal Shah3-Sep-04 7:09 
Generalkeeping child dialog open Pin
BlackDice3-Sep-04 7:03
BlackDice3-Sep-04 7:03 
GeneralRe: keeping child dialog open Pin
PJ Arends3-Sep-04 7:06
professionalPJ Arends3-Sep-04 7:06 

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.