Click to See Complete Forum and Search --> : Problem when adding ScrollView into Dialog


jxu
May 26th, 1999, 01:24 PM
I try to add the scrollview as contorl to the dialog.
I first derived a class from CScrollView (class charttest1:public CScrollView),
then I add charttest1.Create(..) in dialog's OnInitDialog(). the code of charttest1.Create(..)
is as following.
But it doesn't work, it can pass the compiler but always show error when running.
If somebody knows how, please tell me ASAP, thanks very very much.


BOOL charttest1::Create(const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class

static CString classname=AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW);

return CWnd::Create(classname, NULL, WS_VISIBLE|WS_HSCROLL|WS_VSCROLL, rect, pParentWnd, NULL,NULL);
}