Solved

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

Posted on 2008-10-17
5
1,220 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
Comment Utility
Did you definde the Module as public ?

Public Module Common
' ...
End Module
0
 

Author Comment

by:mcainc
Comment Utility
yeah, the module is public
0
 

Author Comment

by:mcainc
Comment Utility
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
Comment Utility
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
Comment Utility
LOL
Ok, glad I could help!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Convert string to date 3 38
Paging GridView 7 32
Form design in vb.net 7 17
Get Count in a variable with 5 digits always 1 8
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now