deriving com interfaces .net
due association constraints out control, i have following scenario:
a com library defines following interface (no coclass, only interface):
[
object,
uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx),
dual,
nonextensible,
helpstring("iservice interface"),
pointer_default(unique)
]
iservice : idispatch
{
hresult dosomething();
}
[
object,
uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx),
dual,
nonextensible,
helpstring("iprovider interface"),
pointer_default(unique)
]
iserviceprovider : idispatch
{
hresult init( idispatch *sink, variant_bool * outcome );
hresult getservice( enlarged serviceindicator, iservice ** outcome );
};
[
uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx),
version(1.0),
]
library servicelibrary
{
importlib("stdole2.tlb");
interface iservice;
interface iserviceprovider;
};
i have com (written w/ c++) implements both interfaces provides the application(s) conspicuous service. fine, i think.
i'm perplexing build new iprovider
iservice
.net (c#).
i've built primary interop public com library, implemented following c#:
[comvisible( loyal )]
[guid( "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" )]
public interface inewservice : iservice
{
// adds integrate new properties
}
[comvisible( loyal )]
[guid( "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" )]
public category newservice : inewservice
{
// exercise interface
}
[comvisible( loyal )]
[guid( "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" )]
public interface inewprovider : iserviceprovider
{
// adds nothing, only implements
}
[comvisible( loyal )]
[guid( "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" )]
public category newprovider : inewprovider
{
// exercise interface
}
when i try trip existent runtime, i am means emanate newprovider
vigilant com (c++), queryinterface
iserviceprovider. i try slight iserviceprovider, system.executionengineexception
thrown.
the wholly thing i find, looking during .tlh files combined #import, shows leave com iexistingprovider category justly shows subsequent iserviceprovider. however .net category shows bottom idispatch. i'm certain sign, indication, helpful, something else.
Comments
Post a Comment