>since static members are not visible by COM, how can I expose
>"LoadFromFile"? Or is there another solution?
Provide another class with an instance method that calls the static
method. Something like
class MyclassFactory
{
public Myclass LoadFromFile(string file)
{
return Myclass.LoadFromFile(file);
}
}
or use Reflection from the COM client. Static methods can't be exposed
directly to COM.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
gk - 05 Sep 2006 16:13 GMT
>> since static members are not visible by COM, how can I expose
>> "LoadFromFile"? Or is there another solution?
[quoted text clipped - 14 lines]
>
> Mattias
ok thanks for the advice.
another problem showed up:
The factory returns a MyClass object. In my project, MyClass implements
2 interfaces. When I run the LoadFromFile method, it returns the default
interface, but not the object itself. This means I cannot access the
second interface. Is this normal behaviour?
gk