Reply

Handeling Events

[ Edited ]

 

Hello All,

 

I followed recommendationsfor using the handeling events. I can see the application events and I was pointed in the right direction. I can see the appication events and write some code in them; how ever I get an error when I set the objAppEvents then none of the handeling events that I am trying to use get triggered. Any help?

This is the code I followed from SE programming documentation:

 

Imports System.Runtime.InteropServices

Imports SolidEdgeFramework

Public Class Form1

Private objApplication As SolidEdgeFramework.Application

Private WithEvents objAppEvents As SolidEdgeFramework.ISEApplicationEvents_Event

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try

' Connect to a running instance of Solid Edge

objApplication = Marshal.GetActiveObject("SolidEdge.Application")

 ' Get a reference to the application events

objAppEvents = objApplication.ApplicationEvents

Catch ex As Exception

Console.WriteLine(ex.Message)

End Try

End Sub

I get an error when the program executes this line:

objAppEvents = objApplication.ApplicationEvents

this is the exception is trowing: event invocation for COM objects requires event to be attributed with DispIdAttribute.

Any help.

Thanks

Sergio

 

 

Posted by: Sergio Vallejo
Post date: 8/31/2011 3:41:59 AM

2 REPLIES

RE: Handeling Events

[ Edited ]

Hi Sergio,

 

try using the type DISEApplicationEvents_Event instead of ISEApplicationEvents_Event.

Seems to work only that way.

 

Posted by: Wolfgang Kunert
Post date: 8/31/2011 11:15:24 PM

RE: Handeling Events

[ Edited ]

^^ saved my day !!! THX

 

Posted by: Linus Hechinger
Post date: 9/28/2011 4:05:21 AM