Class Module / User Defined Type 
Author Message
 Class Module / User Defined Type

I am having a problem with User Defined Types in a class module ...

My code is:

'---------- In a Plain MODULE --------------

Public Type ServerIDType
    UnixSystemName As String
    UnixVirtualIP As String
End Type

Public Type UserJobType
    UnixUserID As String
    UnixUserPassword As String
End Type

'---------------------------------------

'---------- In a CLASS
MODULE --------------------------------------------------------
Public Property Get ServerIDData(ServerID As String) As ServerIDType
    ServerIDData = ServerIDInfo(ServerID)
End Property

Public Property Get UserJobData(UserName As String, JobName As String) As
UserJobType
    UserJobData = UserJobInfo(UserName, JobName)
End Property

'---------------------------------------------------------------------------
----------

The Compile error message is:

"Only public user defined types defined in public object modules
can be used as parameters or return types for public procedures
of class modules or as fields of public user defined types"

Anyone have any ideas on how to correct this problem ...?

Thanks,

Rod Madden




Sun, 06 Jul 2003 10:03:52 GMT  
 Class Module / User Defined Type
Hi,

Change your Public Property ... to Friend Property....

Regards,

John...........

Quote:

> I am having a problem with User Defined Types in a class module ...

> My code is:

> '---------- In a Plain MODULE --------------

> Public Type ServerIDType
>     UnixSystemName As String
>     UnixVirtualIP As String
> End Type

> Public Type UserJobType
>     UnixUserID As String
>     UnixUserPassword As String
> End Type

> '---------------------------------------

> '---------- In a CLASS
> MODULE --------------------------------------------------------
> Public Property Get ServerIDData(ServerID As String) As ServerIDType
>     ServerIDData = ServerIDInfo(ServerID)
> End Property

> Public Property Get UserJobData(UserName As String, JobName As String) As
> UserJobType
>     UserJobData = UserJobInfo(UserName, JobName)
> End Property

> '---------------------------------------------------------------------------
> ----------

> The Compile error message is:

> "Only public user defined types defined in public object modules
> can be used as parameters or return types for public procedures
> of class modules or as fields of public user defined types"

> Anyone have any ideas on how to correct this problem ...?

> Thanks,

> Rod Madden





Sun, 06 Jul 2003 13:02:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Class Module/User defined type query

2. Error using user-defined type in parameter of public procedure in a class module

3. User Defined types into a class module

4. Compiler Error Question, attempting to make a class module see a user defined type

5. Passing an array of user-defined data type to a class module

6. Help: class module and user defined types

7. VB6 Class modules and user defined types

8. Passing Classes to other classes (using user defined types)

9. User Defined Datatypes and Class Modules

10. User Defined Datatypes and Class Modules

11. User Control - User-defined type not defined

12. Classes, Collections, and User Defined Types

 

 
Powered by phpBB® Forum Software