本文整理汇总了C++中CComObject::CreatePages方法的典型用法代码示例。如果您正苦于以下问题:C++ CComObject::CreatePages方法的具体用法?C++ CComObject::CreatePages怎么用?C++ CComObject::CreatePages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComObject
的用法示例。
在下文中一共展示了CComObject::CreatePages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFileNew
LRESULT CPageDesignerApp::OnFileNew(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
CNewDocumentDlg dlg;
dlg.m_numPages = 1;
dlg.m_pageWidth = ConvertSpecifiedValueToUserUnit(UNIT_PT, 612);
dlg.m_pageHeight = ConvertSpecifiedValueToUserUnit(UNIT_PT, 792);
dlg.m_marginLeft = ConvertSpecifiedValueToUserUnit(UNIT_PT, 36);
dlg.m_marginRight = ConvertSpecifiedValueToUserUnit(UNIT_PT, 36);
dlg.m_marginTop = ConvertSpecifiedValueToUserUnit(UNIT_PT, 36);
dlg.m_marginBottom = ConvertSpecifiedValueToUserUnit(UNIT_PT, 36);
dlg.m_columnNumber = 1;
dlg.m_columnGutter = ConvertSpecifiedValueToUserUnit(UNIT_PT, 12);
dlg.m_facingPages = TRUE;
if (dlg.DoModal(GetMainHwnd(), NULL) == IDOK)
{
CComObject<CPDDocument>* pDocument;
CComObject<CPDDocument>::CreateInstance(&pDocument);
if (pDocument)
{
pDocument->AddRef();
pDocument->m_pageWidth = dlg.m_pageWidth;
pDocument->m_pageHeight = dlg.m_pageHeight;
pDocument->m_marginTop = dlg.m_marginTop;
pDocument->m_marginBottom = dlg.m_marginBottom;
pDocument->m_marginInside = dlg.m_marginLeft;
pDocument->m_marginOutside = dlg.m_marginRight;
pDocument->m_columnNumber = dlg.m_columnNumber;
pDocument->m_columnGutter = dlg.m_columnGutter;
pDocument->m_facingPages = dlg.m_facingPages? VARIANT_TRUE: VARIANT_FALSE;
WCHAR str[256];
swprintf(str, L"Untitled%d.pddoc", ++m_nextDocumentIndex);
pDocument->m_fileTitle = str;
pDocument->NewDocument(); // Init (?)
pDocument->CreatePages(dlg.m_numPages);
pDocument->ShowViews();
// CComQIPtr<IUIManager> uiManager = m_frame;
// CComQIPtr<IPDDocument> document = pDocument;
// CComPtr<IUnknown> _this;
// QueryInterface(IID_IUnknown, (void**)&_this);
//uiManager->ActivateObject(GetUnknown(), document);
}
}
#if 0
HINSTANCE hLib = LoadLibrary("C:\\mmsx\\mmstudioplugins\\DOMCOREMOD.dll");
if (hLib)
{
HTMLModalDialogProc HTMLModalDialog = (HTMLModalDialogProc)GetProcAddress(hLib, "HTMLModalDialog");
if (HTMLModalDialog)
{
CComQIPtr<IDOMDocument> xmldoc;
xmldoc.CoCreateInstance(CLSID_LDocument);
xmldoc->put_async(VARIANT_FALSE);
VARIANT_BOOL success;
xmldoc->loadXML(L"<newdocument/>", &success);
CComQIPtr<IDOMElement> element;
xmldoc->get_documentElement(&element);
WCHAR buf[64];
swprintf(buf, L"%d", 1);
element->setAttribute(L"pagesnum", buf);
swprintf(buf, L"%d", 1);
element->setAttribute(L"columnsnum", buf);
swprintf(buf, L"%dpt", 1);
element->setAttribute(L"columnsgutter", buf);
_variant_t arg = (IDispatch*)element.p;
_variant_t result;
HTMLModalDialog(GetMainHwnd(), L"C:\\MMStudio\\pd_newdocument.html", &arg, L"", &result);
CComObject<CPDDocument>* pDocument;
CComObject<CPDDocument>::CreateInstance(&pDocument);
if (pDocument)
{
pDocument->AddRef();
pDocument->NewDocument(); // Init (?)
pDocument->m_pageWidth = 200;
pDocument->m_pageHeight = 400;
//.........这里部分代码省略.........