SetScrollSizes.
-
Hi, My code in OnInitialUpdate is sizeTotal.cx = 1000; sizeTotal.cy = 300; // TODO: calculate the total size of this view SetScrollSizes(MM_TEXT,sizeTotal); Instead of passing the hardcoded values 1000,300 i want them to change them dynamically. eg: sizeTotal.cx = m_nHeight; sizeTotal.cy = m_nWidth; This gives me an assertion error. How can this be achieved. Thanks and regards, Salil.
-
Hi, My code in OnInitialUpdate is sizeTotal.cx = 1000; sizeTotal.cy = 300; // TODO: calculate the total size of this view SetScrollSizes(MM_TEXT,sizeTotal); Instead of passing the hardcoded values 1000,300 i want them to change them dynamically. eg: sizeTotal.cx = m_nHeight; sizeTotal.cy = m_nWidth; This gives me an assertion error. How can this be achieved. Thanks and regards, Salil.
I can only remember an assertion error occuring when some thing other than MM_TEXT is passed as the first argument. The following is from a small paint program I wrote:
void CSPaintView::UpdateScrollSizes()
{
CSize sizeTotal = m_Grid.GetDrawSize();
CSize sizePage(sizeTotal.cx >> 1, sizeTotal.cy >> 1);
sizeTotal.cx += sizeTotal.cx >> 1;
sizeTotal.cy += sizeTotal.cy >> 1;CSize sizeLine(10 \* m\_Grid.GetMag(), 10 \* m\_Grid.GetMag()); SetScrollSizes(MM\_TEXT, sizeTotal, sizeDefault, sizeLine);
}
This function is called from multiple locations in my view class functions and has always worked fine. Just single step into the SetScrollSizes function and look at the place where the assertion occurs (assuming CScrollView derive class). INTP