?
Solved

Exposing User Defined Types

Posted on 1998-09-22
3
Medium Priority
?
148 Views
Last Modified: 2011-09-20
I am accessing the NT System Registry to obtain information and have put this function inside of a Class Module that I plan to access from several different programs I have written. I originally converted all of the information to string type, concatenated into one string, and returned that string from the Class Module. When instantiated, the Class Module returns the info as one long string. This works okay but is not real clean since the calling programs need to unpack the string back to the original parameters.

I thought that I would instead define a user type in the Class Module that would encapsulate all of the System Registry parameters that I needed and pass that user type to other calling programs.

Here is the problem. I can't seem to define a Class Module function return as a type "User Type" and at the same time make it Public so that external programs can get access to it.

Any ideas ?

Mike.
0
Comment
Question by:msturgeo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
DennisH earned 400 total points
ID: 1436050
One simple solution would be to make it a class instead of a UDT.  Then just instantiate the class and set the properties and hand the newly created object off.
0
 

Expert Comment

by:sjrl
ID: 1436051
Define it the UDT as public in a standard module.
0
 

Author Comment

by:msturgeo
ID: 1436052
This solution is simple and it does work. The only change I made was not to make the four System Registry parameters that my class module reads Private then if the registry read is succesful exposing those with four separate "Get" functions, three string returns and one Boolean to match the four parameter types.

Thanks.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month11 days, 8 hours left to enroll

752 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