I am working on an AddIn that was originally created in VB and would work fine.
Now however It has been switched to C# and the only problem I am left with is a constant error that appears whenever solidedge is closed. "Solid Edge has encountered a problem and needs to close. We are sorry for the inconvenience." Obviously it doesnt affect anything as Solidedge was closing anyways but it's still a bug that I would like to fix.
I have narrowed the issue down to the line:
"objAppEvents.AfterWindowActivate += new SolidEdgeFramework.DISEApplicationEvents_AfterWindowActivateEventHandler(objAppEvents_AfterWindowActivate);"
private SolidEdgeFramework.AddIn m_addin;
private SolidEdgeFramework.Application m_application;
private SolidEdgeFramework.DISEApplicationEvents_Event objAppEvents;
public void OnConnection(
m_application = Application as SolidEdgeFramework.Application;
// Set Addin's GUI Version
AddInInstance.GuiVersion = 1;
// Get a reference to the application events
objAppEvents = (SolidEdgeFramework.DISEApplicationEvents_Event)m_application.ApplicationEvents;
catch (System.Exception ex)
WriteOut("Try to set objAppEvents: " + ex.Message, true);
//define the event to be captured later to update the Program Caption
objAppEvents.AfterWindowActivate += new SolidEdgeFramework.DISEApplicationEvents_AfterWindowActivateEventHandler(objAppEvents_AfterWindowActivate);
private void objAppEvents_AfterWindowActivate(object theWindow)
//Any time a window is activated, change the SE caption to show the wanted portion
The code is basically to change the caption of each new window that is opened while running Solidedge. When I remove the line I mentioned above the error will go away but so will the ability to change the caption of the windows.
Posted by: Sean Walsh Post date: 6/21/2012 10:44:16 AM