VC++ Autoserver & RegisterActiveObject
Posted on 1997-07-04
I'm trying to get an automation server to work using
I'm getting the automation server connections to work;
if I could get a copy of the server initialized manually to be the copy which a client used, I'd be happy. The one example which msoft provides is that of their dialog-based
calculator; the code in the client can be copied verbatim to the constructor for the mainframe class of a normal application, and appears to work. It tries to pick up an
existing copy of the server and creates one if that fails.
The code which the server needs would appear to be something like:
clsptr = new CLSID;
regret = CLSIDFromProgID(OLESTR("IISERVER.AUTOMGTD"),
m_dwRegister = 0;
regret = RegisterActiveObject( GetInterface (&IID_IUnknown),
*clsptr, NULL, &m_dwRegister) ;
which doesn't work when transposed to the tail end of the constructor for the mainframe class of the server.
The call to RegisterActiveObject returns an invalid argument code. The GetInterface (&IID_IUnknown) call and its argument compile but, other than that, appear to simply be something being called down out of the sky. Help draws a blank on it. No other reference to IID_IUnknown appears in the mcalc example.