I have been developing components (DLLs) in VB6 for some time now. The components are simple components that has only one or a few class modules. They do not have any object hierarchies or something like that. If a component has more than one class, each class is a stand-alone object and does not have any relation with the other class in the component.
I used to write the code myself without using any tools like the VB Class Builder for example. I usually use the following to create properties, methods and events:
For properties, I use public variables like “Public MyProperty As String”
For methods, I use “Public Sub MyMethod(…) As …” or “Public Function MyMethod(…) As …”
For events, I use “Public Event(…)”
I know that for the properties I need to use the “Property Get …” and “Property Let…” thing, but I don’t really understand the actual difference between that and the method that I use (i.e. using public variables)!
I have also read about interfaces but I have never used them (I think that in my case the use of interfaces is not really necessary!).
So, I would like to ask the following questions. Could someone please give me some in-depth answers and details?
1. Can these components be used, and their properties, methods and events (and enums) be recognized by other programming languages like VC++, Delphi, etc. If not, what should I do to make their properties, methods and events (and enums) recognized by the other programming languages? Use interfaces maybe?
2. If I use the VB Class Builder utility, does this utility create different definitions for the properties, methods and events (by automatically adding some “hidden” embedded code, interfaces, etc.) that will make the components usable and their members recognizable in other programming languages?
3. What is the difference between using public variables for the properties and using the Get and Let?
4. Do I really need to implement interfaces? Or are they not needed for my case?
Probably, I may ask a couple more related questions later on in this thread, or discuss your answers, so please expect some more discussion!
Thank you in advance.