AfterActiveDocumentChange Event

Phenom
Phenom

I am trying to handle the AfterActiveDocumentChange event and getting error

"AddHandler Statement Event Operand must be a dot-qualified expression or a simple name".

 

2016030901.jpg

 

Private oApp As SolidEdgeFramework.Application

Private oAppEvents As SolidEdgeFramework.ISEApplicationEvents

Private oDoc As SolidEdgeFramework.SolidEdgeDocument

 

Sub Main()

oApp = DirectCast(Marshal.GetActiveObject("SolidEdge.Appl​ication"), SolidEdgeFramework.Application)

oDoc = DirectCast(oApp.ActiveDocument, SolidEdgeFramework.SolidEdgeDocument)

oAppEvents = CType(oApp.ApplicationEvents, SolidEdgeFramework.ISEApplicationEvents_Event)

 

AddHandler oAppEvents.AfterActiveDocumentChange(oDoc), AddressOf oApp_AfterActiveDocumentChange

End Sub

 

Private Sub oApp_AfterActiveDocumentChange(ByVal theDocument As Object)

' TO DO

End Sub

 

If I remove the argument oDoc in the AddHandler line, I get an error

"AfterActiveDocumentChange is not an event of SolidEdgeFramework.ISEApplicationEvents"

 

Has anyone seen this error before ?

Any help is highly appreciated.

Thanks.

 

~Tushar

2 REPLIES

Re: AfterActiveDocumentChange Event

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

You cross posted so I'll only reply once in the orignal blog post.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: AfterActiveDocumentChange Event

Phenom
Phenom

Yes, I did.

Thanks Jason  that was a silly overlook.

 

~Tushar