Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

Create an app to show slide.when I click 'Esc' to quit 'Slide Show',PPT quit,too.It is the question.

$
0
0

creating an ATL control to play ppt to show slide or save ppt(office 2013 ver).then embedded into MFC Dialog. when i click 'Esc' to quit slide show,ppt quit too,it is not my mind.i just want to quit slide show,do not want to quit ppt. i do not know how to solve this problem,could anybody help me

Sample code like these:

BOOL CInstanceFactory::OpenOfficeDoc(REFCLSID rclsid,const CString &strPath)
{

        pItem = new CAxDocConCntrItem(pDoc);
        ASSERT_VALID(pItem);
        CString strPath1 = strPath;
        LPCTSTR lpszPath1 = strPath1.GetBuffer();
        pItem->CreateFromFile(lpszPath1, rclsid,OLERENDER_DRAW,CF_TEXT,NULL);    

        m_pItem = pItem;

        LPDISPATCH lpDisp = m_pItem->GetDispatch_PowerPoint();
        PowerPoint::_PresentationPtr  _appPresent = lpDisp;
        DocumentWindowsPtr docsPtr = _appPresent->GetWindows();
        PowerPoint::SlideShowSettingsPtr appSlideRun = _appPresent->GetSlideShowSettings();
        SlideShowWindowPtr slideShowWidnowPtr = appSlideRun->Run();
        slideShowWidnowPtr->Activate();

}

BOOL CAxDocConCntrItem::CreateFromFile(LPCTSTR lpszFileName, REFCLSID clsid,
    OLERENDER render, CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc)

{

    SCODE sc = ::OleCreateFromFile(clsid, T2COLE(lpszFileName),
        IID_IUnknown, render, lpFormatEtc, m_lpClientSite, m_lpStorage,
        (LPLP)&m_lpObject);

}



Viewing all articles
Browse latest Browse all 2257

Trending Articles