Solved

Exposing User Defined Types

Posted on 1998-09-22
3
142 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
3 Comments
 
LVL 1

Accepted Solution

by:
DennisH earned 100 total points
Comment Utility
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
Comment Utility
Define it the UDT as public in a standard module.
0
 

Author Comment

by:msturgeo
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

728 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

14 Experts available now in Live!

Get 1:1 Help Now