Solved

VB.NET - Public structures & error "exposing outside of class"

Posted on 2008-10-17
5
1,235 Views
Last Modified: 2012-05-05
I have a structure that I want to use in several classes defined in a module "Common"

when i try to use a function that will return the the structure to a parent class i get this error

'GetRoomUsers' cannot expose type 'Common.Shared_RoomUserDetails' outside the project through class 'IRCClient'

this is the function

    Public Function GetRoomUsers() As Shared_RoomUserDetails
        Return RoomUsers
    End Function

is it possible to define common structures in modules or is this a bad practice? what am i doing wrong here? I don't understand why this would give me an error.
0
Comment
Question by:mcainc
  • 3
  • 2
5 Comments
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 22746612
Did you definde the Module as public ?

Public Module Common
' ...
End Module
0
 

Author Comment

by:mcainc
ID: 22746618
yeah, the module is public
0
 

Author Comment

by:mcainc
ID: 22746624
oh damnit, you were right... i had the standard definition

Module Common
..
End Module



feel like an idiot :)
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22746627
If the module is public (Public Module Common) then you should have problems.
Can you show some more code how do you have ?
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22746629
LOL
Ok, glad I could help!
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

856 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