I have created a viewer that I have registered and appears under the Viewers menu.
I open the viewer from the menu and from my custom menu on the viewer I add a custom control to the viewer. This custom control takes inputs and sets output depending on its logic. I can see the IO changing under the Simulation panel when running the Simulation.
If I then click the close button (x in top right corner) this closes the viewer but i can still see the IO changing in the simulation panel. If I then goto Viewers and click on my viewer, it opens my viewer but the control I added is not there but the IO is still changing.
Im guessing it has opened another instance of my viewer but I did not implement the ITxMultipleInstanceViewer interface. How do I get the original instance of my viewer with the custom control on it?
When you close your viewer with the x button, it is destroyed. I guess you register to some application events. Make sure that you don't register to any events in the viewer's constructor and make sure that you unregister from the events when viewer is closing. Can you share part of the code?