怎么在VC做的ACTIVEX中实现打印预览??

supervip supervip 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我在ACTIVEX中创建了CFrameWnd,CView 可是在CVIEW中创建的CDialogBar在create的时候总是失败,但我检查了其中的pParent,nIDResource是AFX_IDD_PREVIEW_TOOLBARVC自己带的ID这些对象都是有效的,很奇怪,这种预览方式在CDialog的应用中是实现是没有问题的,这样创建也没保错,就是在Activex这种情况下就出现创建不了了,郁闷ing!



// Create the toolbar from the dialog resource
pView->m_pToolBar = new CDialogBar;
if (!pView->m_pToolBar->Create(pParent, MAKEINTRESOURCE(nIDResource),
CBRS_TOP, AFX_IDW_PREVIEW_BAR))
{
TRACE0("Error: Preview could not create toolbar dialog.\n");
pParent->OnSetPreviewMode(FALSE, pState); // restore Frame Window
delete pView->m_pToolBar; // not autodestruct yet
pView->m_pToolBar = NULL;
pView->m_pPreviewState = NULL; // do not delete state structure
delete pView;
return FALSE;
}
...全文
评论 3
收藏 已收藏
分享
返回顶部
supervip
ATL 3,248 成员 48,530 内容