Against my will I am forced to work with VB6 and I want to do some fancy stuff with it that looks a bit like OOP. I know the OO support in VB6 isn't really great (understatement?) but I'm stuck with it, and I still want to use it for some generic "modules".
I'm stuck on using a user defined type as a parameter in a function of a class-module (as it's called in VB6).
Code:
'//Class module class1
public function func(aa As MyType) As Integer '//Error here
'Stuff
end function
public function func2(ByRef aa As MyType) As Integer '//Error here
'Stuff
end function
Code:
'//module modMyModule
Public Type MyType
memberVar As String
End Type
In the class-module I get the following error:
"Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types"
That's a mouthfull, but I'm not sure what on earth I'm doing wrong. What's this "Object module" they are talking about in the error? There is no module called "Object module" in the IDE. Just "Module".
How can I use my own types in class functions? Or am I pushing VB6 too far for my needs now?