How do I pass a user-defined type to a class method?
I want to make up a user-defined type and pass an instance of
that type to a method in a class.
Public type foo_t
foo1 as integer
Dim foo_instance as foo_t
In the class module:
Public sub class_method(fooey as foo_t)
fooey.foo1 = 42
I have received either of the following two error messages
depending on whether or not a copy of the user-type
declaration was present in the class module.
Private Enum and user defined types cannot be used as parameters
or return types for public procedures, public data members,
or fields of public user defined types
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.
I do not see why this should be so difficult? It is done in C++
every day. The class is strictly in-process; marshalling is not
a consideration. So what is the secret of how to get my user-type
data into the class method?