Trouble instantiatig callback object defined out-of-process
Continuing an issue that you folks helped me with last week...
I set up a callback object and got it working with your help. The
approach is:
class CMySink :
public CComObjectRootEx<CSingleThreadModel>,
public ISink
{
....
BEGIN_COM_MAP(CMySink)
COM_INTERFACE_ENTRY(ISink)
BEGIN_COM_MAP()
....
};
CComObject<CMySink>* pObj = NULL;
HRESULT hr = CComObject<CMySink>::CreateInstance(&pObj);
This works when CMySink is defined locally (created with ATL Simple
Object wizard). But now I'm trying to define ISink in the server, with
#import of the server .tlb file. With that arrangement CMySink compiles
but the CreateInstance call will not compile:
1>c:\program files\microsoft visual studio
8\vc\atlmfc\include\atlcom.h(2612) : error C2259:
'ATL::CComObject<Base>' : cannot instantiate abstract class
1> with
1> [
1> Base=CMySink
1> ]
1> due to following members:
1> 'HRESULT IDispatch::GetTypeInfoCount(UINT *)' : is abstract
....and many more like this.
I tried adding OBJECT_ENTRY_AUTO after my derived class declaration (do
I need it?), but that gives compile errors like:
error C2039: 'UpdateRegistry' : is not a member of 'CMySink'
So I'm stumped on how to instantiate the derived object locally in the
client when the base is defined by the server project. Thanks in
advance for any suggestions.
--
Scott McPhillips [MVP VC++]