Add reference to DCOM server in C#, without type library or IDispatch -


i working on dcom client/server application pair. dcom server in c++, whilst client implented c#. want add reference dcom server, met following error:

a reference "server.exe" can't added, please make sure file accessible , valid assembly or com component.

accessing server c++ test client not problem.

i don't need dcom server accessed vba, objects exposed dcom server derive directly iunknown instead of idispatch, neither server have type library. also, far know, type libraries don't marshal arrays correctly, key requirement. server instead accessed using proxy dll. alternatively, tried c# project reference said dll, returns same error.

is possible solve reference problem without using idispatch or tlb?, problem caused not using type library @ all?

the test client requested @hanspassant

            coinitialize(null);             hresult hr = coinitializesecurity(null, -1 , null, null ,rpc_c_authn_level_connect, rpc_c_imp_level_impersonate, null ,eoac_none ,null);             clsid clsid;             hr = clsidfromprogid(l"hcps.uitvoering.drawingplanning", &clsid);             coserverinfo si;             zeromemory(&si, sizeof(coserverinfo));             si.pwszname = l"localhost";             iclassfactory* pfactory;             hr = cogetclassobject(clsid, clsctx_local_server, &si, iid_iclassfactory , (lpvoid*)&pfactory);             if (hr != s_ok)             {                 return 0;             }              idrawingplanningserver * pserver = null;             hr = pfactory->createinstance(null,  iid_ppv_args(&pserver));             if (hr == s_ok)             {                 cclient client;                              hr = pserver->logon(&client);                 ientry* pentry;                 hr = pserver->createentry(&pentry);                 hr = pentry->save();                 pentry->release();                 hr = pserver->logoff();                 pserver->release();             }             pfactory->release();             couninitialize();             system("pause"); 

and iclient, serves callback interface:

class cclient : public iclient { public:  stdmethodimp queryinterface(refiid riid, lpvoid* ppvobject) {     hresult hr;     if (null == ppvobject)     {         hr = e_pointer;     }     else     {         hr = e_nointerface;         *ppvobject = null;           if ((riid == iid_iunknown) || (riid == iid_iclient))         {             *ppvobject = static_cast<cclient*>(this);             hr = s_ok;         }     }     return hr; }     stdmethodimp_(ulong) addref()     {         return 1;     }     stdmethodimp_(ulong) release()     {         return 1;     }     stdmethodimp new(ientry* entry)     {         return e_notimpl;     }     stdmethodimp update(ientry* entry)     {         return e_notimpl;     }     stdmethodimp delete(ientry* entry)     {         return e_notimpl;     } }; 


Comments