troubleshooting Question

User defined types and user controls

Avatar of Sflea
Sflea asked on
Visual Basic Classic
6 Comments1 Solution190 ViewsLast Modified:
I have a User Control with a public property which I want to be a user defined type. However, when I try to run my code, I get the following error:

"Compile 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"

I used the ActiveX Control Interface Wizard to set up the properties and mapped interface members, and chose the UDT from the drop down list for this property.

The UDT is a public type in a regular module within the same project.

What am I missing?

(I am aware this question is likely worth more than 75 points, but thats all I have right now)

For clarification, it is a standard module (.bas).

Also, in experimenting with this problem further, the UDT is not available from the listbox in the ActiveX Control Interface Wizard, unless, after running the wizard, i change the get and let methods for the property to send/recv the UDT. If I run the wizard after that, the UDT is present in the listbox. Not sure if that makes any difference though.
ASKER CERTIFIED SOLUTION
inthedark

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros