请教如何在基于对话框的应用程序里面添加DialogBar和ScrollView? 我知道在单文档里怎么加,但在对话框里在那里加呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用create一样加,只是设置一下父类 CRect rectWindow; GetClientRect(rectWindow); CRuntimeClass *pViewClass = RUNTIME_CLASS(CMyScrollView); CCreateContext * pContext; pContext = new CCreateContext; pContext->m_pCurrentDoc = NULL; pContext->m_pCurrentFrame = NULL; pContext->m_pLastView = NULL; pContext->m_pNewDocTemplate =NULL; pContext->m_pNewViewClass = pViewClass; CWnd * pWnd = NULL; pWnd = DYNAMIC_DOWNCAST(CWnd,pViewClass->CreateObject()); pWnd ->Create(NULL,NULL,AFX_WS_DEFAULT_VIEW,CRect(0,0,0,0),this,0,pContext); delete pContext; CMyScrollView * pScollView = DYNAMIC_DOWNCAST(CMyScrollView,pWnd); pScollView->SetScrollSizes( MM_TEXT, CSize(rectWindow.right - rectWindow.left-20, rectWindow.bottom -rectWindow.top-100) ); pScollView->MoveWindow(rectWindow.left,rectWindow.top,rectWindow.right - rectWindow.left-20, rectWindow.bottom -rectWindow.top-100,TRUE); http://support.microsoft.com/kb/141751/en-us CTreeView怎么不能编辑呢? 列表视图颜色问题 关于pDc-> SelectObject()的问题 关于VC中用cfile处理二进制wav文件的问题 给各位的算法练习,算算看结果是多少? 代码的优化 (七)(小疯子) 有些源程序是外文的,要是想程序的菜单等改成中文,就会在改的地方出现乱码,不知道怎么解决? 我的vc路,一个郁闷人的烦恼....... 谁知道IDC_...和IDD_...有什么区别????? 谁能告诉我回调(callback)是怎么回事? 如何屏蔽键盘上的Win键和Alt键的功能? SOS请教如何保证每次调用SelectObject()都能成功呢?
GetClientRect(rectWindow);
CRuntimeClass *pViewClass = RUNTIME_CLASS(CMyScrollView);
CCreateContext * pContext;
pContext = new CCreateContext;
pContext->m_pCurrentDoc = NULL;
pContext->m_pCurrentFrame = NULL;
pContext->m_pLastView = NULL;
pContext->m_pNewDocTemplate =NULL;
pContext->m_pNewViewClass = pViewClass;
CWnd * pWnd = NULL;
pWnd = DYNAMIC_DOWNCAST(CWnd,pViewClass->CreateObject());
pWnd ->Create(NULL,NULL,AFX_WS_DEFAULT_VIEW,CRect(0,0,0,0),this,0,pContext);
delete pContext;
CMyScrollView * pScollView = DYNAMIC_DOWNCAST(CMyScrollView,pWnd);
pScollView->SetScrollSizes( MM_TEXT, CSize(rectWindow.right - rectWindow.left-20,
rectWindow.bottom -rectWindow.top-100) );
pScollView->MoveWindow(rectWindow.left,rectWindow.top,rectWindow.right - rectWindow.left-20,
rectWindow.bottom -rectWindow.top-100,TRUE);