Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1310
  • Last Modified:

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

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
mcainc
Asked:
mcainc
  • 3
  • 2
1 Solution
 
jpaulinoCommented:
Did you definde the Module as public ?

Public Module Common
' ...
End Module
0
 
mcaincAuthor Commented:
yeah, the module is public
0
 
mcaincAuthor Commented:
oh damnit, you were right... i had the standard definition

Module Common
..
End Module



feel like an idiot :)
0
 
jpaulinoCommented:
If the module is public (Public Module Common) then you should have problems.
Can you show some more code how do you have ?
0
 
jpaulinoCommented:
LOL
Ok, glad I could help!
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now