Solved

Exposing User Defined Types

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA open file from excel cell 4 44
SSRS expression Issue finding a string 10 91
Copy a row 12 64
Excel VBA - Run Time error '1004' Application-defined or object-defined error 4 206
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

832 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