andrew_Inwood

How to hook into the Application.DisplayOpen event

Discussion created by andrew_Inwood on Jun 26, 2013
Latest reply on Jun 27, 2013 by dhollebeek

I have a C# application the creates a PI Application using the PI Processbook Type Library.  I want to have my own event handler that fires when the Application.DisplayOpen event fires.

 

 This is what I have so far:

 
public delegate void DisplayOpenHandler(object sender, EventArgs e);

public void DisplayOpenMessage(object sender, EventArgs e)
{
    MessageBox.Show("Caught Display Open!");
}

 I set it with: 

 
m_oPIApp.OpenDisplay += new DisplayOpenHandler(DisplayOpenMessage);

where m_oPIApp is a PBObjLib.Application object.

 

Unfortunately, this gives me a compile error:
Cannot implicitly convert type 'PI_Display_Manager.PI_Application_Handler.DisplayOpenHandler' to 'PBObjLib.EApplication_OpenDisplayEventHandler'

 

Can someone give me a steer on what I need to do here?

 

 

Outcomes