Click here to Skip to main content
15,916,288 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Thread count limit??? Pin
Anonymous7-Apr-04 4:15
Anonymous7-Apr-04 4:15 
GeneralHiding Menu Option in VC7 Pin
PrashantJ7-Apr-04 0:06
PrashantJ7-Apr-04 0:06 
GeneralUDP listen sockets don't get any data behind Firewall (ZoneAlarm) Pin
clayman876-Apr-04 23:36
clayman876-Apr-04 23:36 
GeneralBitmaps vs. CDC drawing functions Pin
adiior6-Apr-04 23:31
adiior6-Apr-04 23:31 
GeneralImplementing HTTP Client Pin
Madhavi Watve6-Apr-04 22:56
Madhavi Watve6-Apr-04 22:56 
GeneralRe: Implementing HTTP Client Pin
Ravi Bhavnani7-Apr-04 1:22
professionalRavi Bhavnani7-Apr-04 1:22 
GeneralRe: Implementing HTTP Client Pin
2249177-Apr-04 1:23
2249177-Apr-04 1:23 
GeneralAnother problem scrolling large document Pin
Still learning how to code6-Apr-04 22:22
Still learning how to code6-Apr-04 22:22 
A week or so ago, I posted a request for help with scrolling large documents - I was hitting the 16 bit limit imposed within SetScrollSizes() and could not scroll to the end of the document. As a reply, I was pointed to look at SCROLLINFO. I have used this in addition to SetScrollSizes() and this initially seemed to solve my problem. It was a short time later that I noticed "a hole" in the window view after scrolling a good way down. I have been disecting my code ad-nauseum without understanding what the problem was. Eventually, I was driven to create a minimal test app to see if the problem was reproduced. It purely prints the line number from 1 to 2155 on consecutive lines. Everything is fine as you scroll down, but when you get to line 2048 (the 32768 pel boundary) a block of blank lines start appearing. Continuing to scroll down, line numbers appear again at either 2056 if scrolling by page, or 2093 if scrolling by line. Scrolling up produces different boundaries, but normal operation does occur at line 2048. (Some of the lines missing in the scroll down "appear" when scrolling up, by the way !!
My OnSize() function for the test app is as below:-

void CTestView::OnSize(UINT nType, int cx, int cy)
{
CScrollView::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
TEXTMETRIC tm;
CDC *pDC = this->GetDC();
pDC->GetTextMetrics( &tm);
m_sizeChar.cy = tm.tmHeight;
m_sizeChar.cx = tm.tmAveCharWidth;

m_sizeClient.cx = cx;
m_sizeClient.cy = cy;

m_sizeDoc.cx = 1024;
m_sizeDoc.cy = 2155 * m_sizeChar.cy;
CSize sizeLine(1,1);

SetScrollSizes(MM_TEXT, m_sizeDoc, m_sizeClient,sizeLine);

// Following code gets over 16 bit restrictions encountered in SetScrollSizes()

SCROLLINFO info;
BOOL rc;
rc = GetScrollInfo(SB_VERT, &info, SIF_PAGE|SIF_RANGE);
if(!rc)
AfxMessageBox("GetScrollInfo() failed");

info.fMask = SIF_PAGE|SIF_RANGE;
info.nMin = 0;
info.nPage = m_sizeClient.cy;
info.nMax = m_sizeDoc.cy - 1;
rc = SetScrollInfo(SB_VERT, &info, TRUE);
if(!rc)
AfxMessageBox("SetScrollInfo() failed");

}

It's obvious that I'm hitting ANOTHER 16-bit "problem", but I can't see where it is.

Can some kind soul point me in the right direction ! ? Many thanks in advance !

Doug
GeneralRe: Another problem scrolling large document Pin
Roger Allen6-Apr-04 22:52
Roger Allen6-Apr-04 22:52 
GeneralProblem with setting timeout in C++ Pin
ArFuk6-Apr-04 22:07
ArFuk6-Apr-04 22:07 
GeneralRe: Problem with setting timeout in C++ Pin
Rage6-Apr-04 22:21
professionalRage6-Apr-04 22:21 
GeneralRe: Problem with setting timeout in C++ Pin
ArFuk6-Apr-04 22:45
ArFuk6-Apr-04 22:45 
GeneralRe: Problem with setting timeout in C++ Pin
Maxwell Chen6-Apr-04 23:38
Maxwell Chen6-Apr-04 23:38 
GeneralProblem with windows and frames. Pin
Victor Nikol6-Apr-04 21:58
Victor Nikol6-Apr-04 21:58 
GeneralPossible errors when using CDialog::Create(); Pin
anderslundsgard6-Apr-04 21:05
anderslundsgard6-Apr-04 21:05 
QuestionHow much voltage is required to operate a seven segment LED Pin
Member 9936936-Apr-04 20:38
Member 9936936-Apr-04 20:38 
AnswerRe: How much voltage is required to operate a seven segment LED Pin
Rory Solley6-Apr-04 22:02
Rory Solley6-Apr-04 22:02 
AnswerRe: How much voltage is required to operate a seven segment LED Pin
Prakash Nadar6-Apr-04 22:26
Prakash Nadar6-Apr-04 22:26 
Generaljpeg convert to bmp Pin
daoyu20006-Apr-04 18:47
daoyu20006-Apr-04 18:47 
GeneralRe: jpeg convert to bmp Pin
Antony M Kancidrowski7-Apr-04 2:21
Antony M Kancidrowski7-Apr-04 2:21 
GeneralRe: jpeg convert to bmp Pin
daoyu20007-Apr-04 23:48
daoyu20007-Apr-04 23:48 
GeneralRe: jpeg convert to bmp Pin
Antony M Kancidrowski8-Apr-04 2:25
Antony M Kancidrowski8-Apr-04 2:25 
GeneralRe: jpeg convert to bmp Pin
daoyu20008-Apr-04 4:25
daoyu20008-Apr-04 4:25 
GeneralApplication change to Service can not receive message Pin
tank10256-Apr-04 18:00
tank10256-Apr-04 18:00 
GeneralRe: Application change to Service can not receive message Pin
2249176-Apr-04 19:11
2249176-Apr-04 19: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.