Multiple instances of POWERPNT.exe in OLE automation

R

RAHUL

Hi All,

In my C++ application I try to connect to PowerPoint (using the below
mentioned source code) and then ask it to open a PPT file, I also
allow the user to save the file being edited and at that time also I
retrieve the PowerPoint object using the same calls and then call a
activePresentation.Save().

But with a particular version of PowerPoint (11.8169.8172) the save
fails with an "RunTime error (NO active presentation found)"
When this error happens I could see 2 instances of POWERPNT.exe in
task manager, this problem does not happen on my other machine which
has 11.8307.8221 and there only one instance of POWERPNT.exe runs at
any point of time.

I wanted to know, why is the second instance of POWERPNT.exe created
while one is already running and what could be the triggering point
for this?
Any help or pointers are greatly appreciated.

Thanks in advance
Rahul


CLSID clsid;
hr = CLSIDFromProgID(L"PowerPoint.Application", &clsid);
if(SUCCEEDED(hr))
{
IUnknown * pUnk = NULL;
hr = ::GetActiveObject(clsid, NULL, (IUnknown**)&pUnk);

if(SUCCEEDED(hr))
{
IDispatch * pPPApp = NULL;
hr = pUnk->QueryInterface(IID_IDispatch, (void **)&pPPApp);

// ........... some other code
 

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