I have a couple of questions about developing an out-of-proc (local) COM server using ATL.
I need to figure out how to make the server function as a single instance. Currently, any call by a client app to CoCreateInstance will launch a new instance of my server. Is there a macro or define that I am missing?
I am also having trouble getting QueryInterface to work properly on an exposed class. I can only get a IUnknown ptr to my object. If the client calls QueryInterface to get a different interface, I can see via traces (from defining _ATL_DEBUG_INTERFACES and _ATL_DEBUG_QI) that the QI call on my object (in the exe) succeeds, but but the refcount is only going to 1, then QI succeeds, then release is called, dropping the refcount back to 0. (I am using the singleton class factory.) The call in the client is returning E_NOINTERFACE.
I would appreciate any ideas or suggestions on where to get help.