atl - QueryInterface of out-of-proc COM server on interface imported from TLB -
i define interfaces in a.idl file, compile a.tlb
in vs2005 atl project "b" use importlib(a.tlb) in b.idl , #import "a.tlb" in stdafx.h , implement interface ia a.tlb in atl com class. project outputs b.dll , b.tlb
i add b.tlb refererences of c# application , within code instantiate com object.
the instantiation works without problems if use either
type.gettypefromclsid(); activator.createinstance(...);
or
[dllimport("ole32.dll", ...)] cocreateinstance(...)
both work fine, object instantiates , i can cast ia interface defined in a.tlb (actually rcw generated tlb) , invoke methods. still no problems.
then use oleview enable com object activation using default dllhost.exe surrogate.
the instantiation of com object within surrogate (parameter clsctx_local_server in cocreateinstance) still without problems, when try cast object ia interface defined in a.tlb e_nointerface , message saying queryinterface failed because "no such interface supported".
please help. wrong? if need additional info, i'll try provide as possible.
you need build , register proxy/stub dll. required marshal interfaces across process boundaries. can't find great msdn page it, mentioned here.
Comments
Post a Comment