I have a COMVisible
class MyAPI that my clients are going to use as the root object for all API access.
I have my APIs in another assembly OtherAPI that has Document and Window API classes (not COM visible).
I want to expose Document and Window classes via MyAPI class to a late binding client such as JavaScript.
[COMVisible(true)]
class MyAPI
{
public OtherAPI::Document NewDocument()
{
return new OtherAPI::Document();
}
}
// Something like this should work in the client code
(new MyAPI()).NewDocument().GetName();
The problem is that it does not see GetName because that is not COM visible
I think.
I can wrap each and every function from Document and Window class in this class but I am looking for an elegant solution. I want my clients app to be able to use both Document and Window class functions via MyAPI object.