I’m working on a Visual Studio package for MySQL and discovering that it is
possible to write hundreds of pages of documentation and still not be able to
answer some of the most basic questions.  Microsoft does it over and over
again. 

In this case I’m using managed code to create a custom editor for our
database objects (think Server Explorer).  I don’t want to register a file
extension.  After considerable trial and error, I got  a chunk of code
working.  This code called IVsUIShellOpenDocument.InitializeEditorInstance
and IVsUIShell.CreateDocumentWindow and my editor appeared.  However, it
would not prompt to save when the window pane was closed.  GetDocumentInfo
showed an edit lock on my document but UnlockDocument could not remove it.

I replaced this code with simpler code that called
IVsUIShellOpenDocument.OpenSpecificEditor and my documents suddenly started
prompting to save properly.  I had wanted to avoid going this route because
it requires an editor factory class that I thought was unnecessary.  Oh
well.  Unnecessary working code is better than sleek busted
code.