Solved

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

Posted on 2008-10-17
5
1,240 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

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

713 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