Solved

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

Posted on 2008-10-17
5
1,258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that undeā€¦
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

617 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