文件名称:MFC显示PPT
文件大小:2.36MB
文件格式:ZIP
更新时间:2017-04-29 06:48:38
MFC PPT
用MFC 显示PPT //启动 PowerPoint: void CMainFrame::OnPowerpointStartpowerpoint() { /// Check if the IDispatch connection exists with PowerPoint, // if not create one. if (m_ppt.m_lpDispatch == NULL) { // Create IDispatch connection to PowerPoint. m_ppt.CreateDispatch("PowerPoint.Application"); }; // Bring the PowerPoint application to the front. m_ppt.Activate(); } void CMainFrame::OnPowerpointStartslideshow() { _Presentation oPresentation; SlideShowSettings oShow; // Attach to the Active Presentation. oPresentation.AttachDispatch(m_ppt.GetActivePresentation()); // Attach to the slide-show settings. oShow.AttachDispatch(oPresentation.GetSlideShowSettings()); // Run the slide show. oShow.Run(); } // 创建幻灯片: void CMainFrame::OnPowerpointCreateslide() { // Connect to the active presentation. There is no error trapping. // If the active presentation the framework traps // the error and displays a message box. _Presentation ActivePresentation(m_ppt.GetActivePresentation()); // Connect to the slides collection. Slides oSlides(ActivePresentation.GetSlides()); // This constant is defined in the PowerPoint Object model. // You can use the Object Browser, with Visual Basic Editor // (VBE), to look up the different constant values. const ppLayoutTitleOnly = 11; // Add a new slide to the presentation. This code adds the new // slide to the end of the presentation. oSlides.Add(oSlides.GetCount() + 1l, ppLayoutTitleOnly); } // 创建演示文稿: void CMainFrame::OnPowerpointCreatepresentation() { Presentations PresCollection; // Make sure there is a dispatch pointer for PowerPoint. if(m_ppt.m_lpDispatch == NULL) { // Display a message indicating that PowerPoint is not running. MessageBox("PowerPoint is not running.", "Start PowerPoint"); } else { // Bring PowerPoint to the front. m_ppt.Activate(); // Attach the presentations collection to the PresCollection // variable. PresCollection.AttachDispatch(m_ppt.GetPresentations()); // Create a new presentation. PresCollection.Add(1);
【文件预览】:
TestPPT
----TestPPT.dsw(522B)
----resource.h(921B)
----TestPPT.cpp(6KB)
----msppt.h(13KB)
----Debug()
--------vc60.pdb(372KB)
--------TestPPT.exe(152KB)
--------vc60.idb(217KB)
--------StdAfx.obj(103KB)
--------TestPPT.tlb(1KB)
--------TestPPT.res(7KB)
--------MainFrm.obj(40KB)
--------TestPPT.obj(25KB)
--------TestPPT.pdb(585KB)
--------msppt.obj(201KB)
--------TestPPTView.obj(19KB)
--------TestPPTDoc.obj(20KB)
--------TestPPT.pch(5.25MB)
--------TestPPT.ilk(398KB)
----msppt.cpp(48KB)
----TestPPT.h(1KB)
----TestPPT.dsp(5KB)
----TestPPT.clw(2KB)
----TestPPTView.cpp(3KB)
----TestPPTDoc.cpp(2KB)
----ReadMe.txt(5KB)
----TestPPT.odl(1KB)
----TestPPT.reg(682B)
----res()
--------Toolbar.bmp(1KB)
--------TestPPT.ico(1KB)
--------TestPPT.rc2(399B)
--------TestPPTDoc.ico(1KB)
----TestPPT.ncb(97KB)
----TestPPTView.h(2KB)
----MainFrm.h(2KB)
----TestPPT.opt(48KB)
----TestPPTDoc.h(2KB)
----StdAfx.cpp(209B)
----TestPPT.rc(12KB)
----MainFrm.cpp(7KB)
----StdAfx.h(1KB)
----TestPPT.plg(1KB)
----TestPPT.aps(44KB)