Powerpoint doesn't terminate

P

Peter Carlson

Using the following C++ (Non-MFC) code POWERPOINT.EXE keeps running even
after the quit. Any ideas as to why?

CComPtr<PowerPoint::_Application> app;
if (app.CoCreateInstance(L"Powerpoint.Application", NULL,
CLSCTX_LOCAL_SERVER) == S_OK) {
PowerPoint::presentations *Presentations;
app->get_Presentations(&Presentations);
PowerPoint::_Presentation *Presentation;
CComBSTR bstrFile("c:\\projects\\ppt_test\\12345");
Presentations->Open(bstrFile+_T(".ppt"), Office::msoFalse,
Office::msoTrue, Office::msoFalse, &Presentation);
Presentation->SaveAs(bstrFile, PowerPoint::ppSaveAsMetaFile,
Office::msoFalse);
app->Quit();
}


Peter
 
P

Peter Carlson

ATL group had the answer, wasn't releaseing a couple of references changing:
PowerPoint::presentations *Presentations;
PowerPoint::_Presentation *Presentation;
to
CComPtr<PowerPoint::presentations> Presentations;
CComPtr<PowerPoint::_Presentation>Presentation;

Solved it
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top