Hello Chris,
Private Sub New()
End Sub
This was what I checked out, but if I reference the library in an
other project, class becomes a default public ctor, that is what
I don't want.
I'm not sure what you mean here. If you provide a Private Sub New,
then the class cannot be instantiated directly from another class. The
compiler only supplies a default constructor if you don't explicitly
declare one. As for inheritance, constructors are not inherited so any
derived classes will have to have a private constructor as well if you
want to prevent them from being instantiated directly.
It's problem of missviewing in the VB.NET Express 2005 IDE. The IDE
adds allways a Public Default Constructor to my classes in class view,
which not exists. I have now tried all kinds of Construtors, the test can
be download from this URL :
http://www.vbwebprofi.de/public/_new...nstructors.zip
The result of my test is that
Protected Friend Sub New()
or
Protected Friend Sub New(ByVal in_Parameter As Object)
and
Friend Sub New()
or
Friend Sub New(ByVal in_Parameter As Object)
fit the former Public Not Creatable in VB6. The both first implementations
give programmers the option to inherit my class and call my own constructor
with MyBase.New() or MyBase.New(MyParameter).
Regards
Holger