Solved

Passing user defined types between modules

Posted on 1998-07-24
2
280 Views
Last Modified: 2010-05-03
Is it possible to pass user defined types between modules? I am receiving the following error message if I pass an instance of my type to a public sub: "User-defined types and fixed-length strings not allowed as the type of a Public member of an object module; Private object modules not allowed as the type of a public member of a public object modules", passing to a private sub in the same module is OK.

0
Comment
Question by:mark_s
2 Comments
 
LVL 1

Accepted Solution

by:
gissing earned 50 total points
ID: 1466584
If you want to pass a UDT between two modules, the UDT has to be declared as public, so that both modules can see it.
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1466585
Classes can not have methods that have parameters using UDTs... if they are exposed (public).   To combat this, you can do one of 2 things:

1)  Build another class, which just has variables for your type, and pass that

2)  Build a collection to pass back and forth, using the KEY as the name of each variable


Mark's answer is wrong in this case..  He's correct for bas modules.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now