Re: Unable to pass an object
- From: Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Thu, 16 Aug 2007 15:06:53 -0700
Lilith wrote:
[...]
Inconsistent accessibility: parameter type 'GWIAmon.AllCfg' is less
accessible than method 'GWIAmon.Config.SetCfg(GWIAmon.AllCfg)
I think what I'm seeing from searches is that the object has to be of
a public class, though I'm not sure what that means.
It sounds as though your class is called "AllCfg", that you have a main
form class called "Config", which has a public method "SetCfg". Is that
correct?
If so, then the error is complaining that the method is public, but the
class "AllCfg" is not. If you don't put the "public" key word as part
of your class declaration, then the class isn't public and can't be used
as the type in other public members, like a method return type or
parameters.
So, in other words, the searches you've apparently already done have
already told you the problem. You just need to declare the class as
public. If you understand the difference between other things being
public, protected, private, or internal, then it's not clear to me why
you wouldn't also understand what it means for a class to be public.
It's the same thing.
If the above doesn't answer your question, you need to post a
concise-but-complete sample of code that demonstrates the problem you're
having. That way someone can explain how to change the code so that it
works.
Pete
.
- Follow-Ups:
- Re: Unable to pass an object
- From: Lilith
- Re: Unable to pass an object
- References:
- Unable to pass an object
- From: Lilith
- Unable to pass an object
- Prev by Date: Re: Easiest way to bridge designer and programmer (ASP.NET in C#)
- Next by Date: Re: Something I'd like to see in C#
- Previous by thread: Unable to pass an object
- Next by thread: Re: Unable to pass an object
- Index(es):