So as a test (using the SDK's Office Plan sample), I added another Visio control and a button to the form. When I click the button, it loads a hard-coded Visio file into the new control.
This works fine, so I guess that the event sinks are causing problems with the Office Plan's Visio control.
However, when I close the application, I get a LoaderLock error, and the application doesn't shut down properly.
"LoaderLock Detected:
Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang."
I get this error regardless of whether I do anything with the new control, and it is still there when I remove the new button and new Visio control. So I wonder if the LoaderLock problem was there before I started messing around.
By the way, I've seen the LoaderLock problem before, and was able to get rid of it by unchecking something under Tools > Options > Debugging, but I don't remember what it was, or whether it was a good idea to uncheck it.