I made this neat manager (in a class module) that manages some complex datastructures.
I want to display some information of these datastructures in a form.
So I thought it'd be nice to make a function that returns one of these structures.
Code:
' in the class module
public function getStructure() as myUDT
end function
Code:
' in a module
public type myUDT
en type
Now, my good intentions were quickly shattered by VB (I swear to god, the guy who came up with this nonsense should be shot in the face... with a torpedo). It says:
Quote:
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.
|
In my eyes I did exactly as described in the message. My UDT is public, in a public module, and it's used in a public procedure of a class module.
Moving the UDT to the class itself doesn't work either as it cannot be public (so not accessible from the form), nor can I make it public inside the class as that isn't allowed either.
I also tried returning an "Object", but that gives me an "incompatible type" error.
So, how am I going to do this? Google came up with having a "MultiUse Class" and accessing the UDT as "myClass.myUDT", but I can't find anything about making such a "MultiUse Class".