conversion is inaccesible

Started by
1 comment, last by alnite 19 years, 7 months ago
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.
Advertisement
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.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Fruny, you are as helpful as you always are.

This topic is closed to new replies.

Advertisement