Slide Show problem

C

Calin

Hello

I builded a sink for PowerPoint events which catches the SlideShowBegin
event. On this event handler I modify the content of the presentation
slides, then I return back. So far, so good, but after I return from this
event handler, suddenly I get an SlideShowEnd event and the current
presentation it is closed.

Does anyone have an ideea why the show ends unexpectedly ?

Thanks, Calin
 
C

Calin

Thanks for your answer. Here is the source code of the event handler.



STDMETHODIMP CPowerPointSink::OnSlideShowBegin(IDispatch *pSlideShowWindow)
{
TRACEFN(_T("\nCPowerPointSink::OnSlideShowBegin() ------------>>"));
CComQIPtr<SlideShowWindow> ptrSlideShowWindow(pSlideShowWindow);
if(!ptrSlideShowWindow))
{
TRACEX(_T("Uninitialized data in CPowerPointSink::OnSlideShowBegin()\n"));
return E_FAIL;
}
CComQIPtr<_Presentation> ptrPresentation = ptrSlideShowWindow->GetPresentation();
if(!ptrPresentation)
{
TRACEX(_T("Cannot get presentation interface in CPowerPointSink::OnSlideShowBegin()\n"));
return E_FAIL;
}

try
{
// Remove the current content
ptrPresentation->Slides->Range()->Delete();

// Import the content from a temporary file
ptrPresentation->Slides->InsertFromFile(_bstr_t(strTempPresentation.c_str()), 0, 1, -1); // strTempPresentation is a valid value
}
catch(_com_error &e)
{
DumpComError(e.Error(),_T("Exception while replacing the presentation content in CPowerPointSink::SetDummyContent()"));
}
catch(...)
{
TRACEX(_T("Exception in CPowerPointSink::OnSlideShowBegin()\n"));
}

return S_OK;
}



I just try to remove the current content and then replace it with something imported from a file (which is a ppt file).

Thanks, Calin
 

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