Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

nagromo

.dll and static members

This topic is 5282 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In a class in a (C#/.Net) .dll, how can you access its static members? My main program gets a compiler error (''GameWorld.World'' is inaccessable due to protection level) when I try to access a public static member of a public class in my GameWorld.dll. Is there a way to access these members?

Share this post


Link to post
Share on other sites
Advertisement
If you used a static "getter" and "setter" function that would probably appease the compiler.
Also check that everything is declared public - the class AND the declared variable.

As a side note I would consider trying to figure a way so you *don''t* use global variables over different assemblies if at all possible. C# is built purposefully to make that kind of thing a bit more difficult and tries to encourage more OO thinking.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!