开发者

Com Visibility in referenced assemblies

If I have the follwing assemblies:

MyComVisibleApi: a .Net assembly that is used by a VB a开发者_如何学Cpp

MyReferencedAssembly: a .Net assembly referenced by MyComVisibleApi

Does MyReferencedAssembly need to be ComVisible if its functionality is never directly referenced by the VB App?

Thanks!


You shouldn't have to make MyReferencedAssembly ComVisible unless you use types from MyReferencedAssembly in the public signatures of MyComVisibleApi. Public signatures include properties, method parameters and return types.

There is also a special case: if you derive a ComVisible type from a type that is not ComVisible, public base class members will be exposed to COM as members of the derived class unless those members are individually [ComVisible(false)].

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜