I've come across something unusual in Windows 7 64bit, SW2010 SP0 and SP4. This issue cannot be reproduced in Windows XP.
Attached is a simple VS2010 NET4 C# addin solution that creates a TaskPane and registers to DSldWorksEvents_ActiveModelDocChangeNotifyEventHandler. The callback method when the active document changes, subscribes the PartDoc (must be a part document) like so:
((PartDoc)_swApplication.IActiveDoc2).FileSaveNotify += new DPartDocEvents_FileSaveNotifyEventHandler(SwAddinUnitTest_FileSaveNotify);
((PartDoc)_swApplication.IActiveDoc2).DestroyNotify2 += new DPartDocEvents_DestroyNotify2EventHandler(SwAddinUnitTest_DestroyNotify2);
The callbacks for file save and file destroy write a line to the task pane's list view. That's it.
Here are the steps to reproduce the problem:
1. On Win7 64bit with SW2010 run REG64.NET4.BAT (from a CMD started AS Administrator)
2. Start up SW
3. Click on the custom TaskPane so that it is visible
4. Open a Part document
5. Click the Save button
6. Close the part document
7. Step 5 and 6 should add two items to the list view:
"DocumentDestroy Callback"
"FileSave Callback"
but in my case, this does not happen.
Repeat the above steps, skipping step3. After the steps click on your custom taskpane and you will see that all document events fired just fine.
After you're done run REG64.NET4.BAT
What is happening here?
SolidworksApi macros