Well, it's Friday, and it looks like the regulars around here vanished early.
I have limited experience with interfaces, but I'll take a shot at it since
you have not gotten a response yet.
I have 3 ideas:
1) If you implement a member from the interface, it cannot be shared. OK.
But if the same function could be morphed with a different signature,
probably by changing or adding a parameter, you could have a shared version
of the function in addition to the one required by the interface.
Public Function CleanMyHouse() as Integer Implements theClass.CleanM yHouse
'...
End Function
Public Shared Function CleanMyHouse(Sh ared as boolean) as Integer
'Ignore the parameter
'...
End Function
2) You can add members to a class that are in addition to the interface.
Similar to the above solution, but use different function names.
3) You could implement the interface, then remove references to the
interface, then allow members to be shared. This would not be a strict usage
of the interface, but might resolve the problem.
I am not sure about the COM requirements, so not sure if any of this will
work.
www.charlesfarriersoftware.com
"Elephant" wrote:
Hello, question,
I want to make a COM-compatible .NET DLL (Visual Basic). For this I need an
interface. The DLL has a class that must contain methods that can be used
without making an instance of the class first.
So I have a class that has methods that derrive from an interface, and the
same class has methods that are Shared....but methods that are derrived from
an interface are not allowed to be Shared...
How to solve this? Any Tricks. Somewhere I read that this rule does not
apply to classes that are NotInheritable, but it doesn't work.
Any help would be great,
me.