Solved

Exposing User Defined Types

Posted on 1998-09-22
3
146 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 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 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