Re: Unable to pass an object

Tech-Archive recommends: Speed Up your PC by fixing your registry



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
.