I have a C# class library and also have a powerbuilder application. I want to expose the c# class and use it in the powerbuilder application. I used the following blogs to e
[ClassInterface(ClassInterfaceType.None)]
That means that none of the class implementation details are visible, the proper and pure COM way. So it is not necessary to apply [ComVisible(false)] on methods you don't want to expose. Only the Iinterface
methods are visible.
Using, say, ClassInterfaceType.AutoDual is a convenience in .NET, the CLR will synthesize an interface automatically. It matches the behavior of old versions of Visual Basic (VBA, VB6), they did not support interfaces yet. It does however expose too much, the methods inherited from System.Object (like GetHashCode etc) will be visible as well without a decent way to hide them. You also get a dependency on the mscorlib.tlb type library. So declaring the interface explicitly like you did is the certainly better way.
The target machine must have .NET installed, rock-hard requirement.