Sign in to follow this  

conversion is inaccesible

This topic is 4845 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

I have Block class that inherits from IKeyboardReader interface. I also have Keyboard class with a function that accepts a reference to IKeyboardReader interface. class Block : public (some other classes), IKeyboardReader; class Keyboard {    void foo( IKeyboardReader& r ); } Now, I tried to pass an instance of Block class to this function but VS.NET 2002 gives me an error saying that conversion exists but is inaccessible. If I typecast it ( (IKeyboardReader&) ), the errors become warnings, but it still displays the same message. Not sure what's going on here.

Share this post


Link to post
Share on other sites
class Block : public (some other classes), public IKeyboardReader;

You must repeat the public keyword in front of every public bases, otherwise they'll be private.

Share this post


Link to post
Share on other sites

This topic is 4845 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this