From: myjpa on

I'm trying to catch ppt's events like SlideShowNextSlide,
SlideShowNextClick, and PresentationOpen. I started the ppt
application by using Powerpoint.Application COM object in "Microsoft
Powerpoint 10.0 Object Library".

I've failed to catch the event both by C# event binding routines and
through IConnectionPointContainer and IConnectionPoint. I'm searching
for a pure C# solution for catching the powerpoint application's
events, but not a mixture solution of C# and VBA.

This is my code, I'm wondering what the problem is in this code?

public class PPTEventHandler
private PowerPoint.Application m_app;
private Presentation m_pre;
private UCOMIConnectionPoint m_connectionPoint;
private int m_cookie;

private void button1_Click(object sender, EventArgs e)
//...code to start ppt application omit...
// QI for IConnectionPointContainer.
UCOMIConnectionPointContainer oConnPointContainer =
// Get the GUID of the EApplication interface.
Guid guid = typeof(PowerPoint.EApplication).GUID;
// Find the connection point.
oConnPointContainer.FindConnectionPoint(ref guid, out
// Call Advise to sink up the connection.
m_connectionPoint.Advise(this, out m_cookie);

//event handlers
public void SlideShowBegin(PowerPoint.SlideShowWindow Wn)

public void SlideShowNextBuild(PowerPoint.SlideShowWindow Wn)

public void SlideShowNextSlide(PowerPoint.SlideShowWindow Wn)
//other event handlers omit...