关于Office组件和Qt集成问题
小弟现在正在研究如何将PowerPoint嵌入到qt中,现遇到点问题
1.使用Qt提供的工具dumpcpp将MSPPT.OLB的头文件导出,现有powerpoint.h、powerpoint.cpp,
其中使用其中的Application可以初始化Powerpoint,如下代码:
PowerPoint::Application *pptApp = new PowerPoint::Application();
if (pptApp != NULL && pptApp->isNull() == false)
{
//Office::MsoTriState state = pptApp->Active();
pptApp->dynamicCall("SetVisible(Office::MsoTriState)",true);
PowerPoint::Presentations* presentations = pptApp->Presentations();
if (presentations != NULL )
{
PowerPoint::Presentation *presentation = presentations->Open("D:\\1.pptx");
}
}
pptApp->Quit();
delete pptApp;