Ok - one issue that I'd like someone on the MC dev team to look into is the AddRef after a successful GetActiveObject. I seem to remember (and some quick browsing of MSDN doesn't show me anything to discount this) that GetActiveObject already returns a refcounted object.
That AddRef, however, I don't think is the cause of my problem (which has returned).
A little more debugging shows that when the problem happens, the call to GetActiveObject (which should succeed since MC is already running) returns:
hr = 0x800401e3 "Operation unavailable"
Then the CreateInstance call works. The second run of the program, the GetActiveObject fails again in the same way, but this time the CreateInstance call also fails.
This happens even if MC was just launched. (I am not sure what caused the GetActiveObject to start working on my machine for a bit, but when I tried to exit MC after it was working, MC just hung, so something was in a weird state.)
Any thoughts?
Thanks!
-Jeff