Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Private and protected inheritance

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Lucky Luck Posted - Mar 18 2006 : 4:36:38 PM
Popup menu not correctly displays the information on methods of a class,
when it is inherited with the "private" or "protected" access modifiers...

---------------------------------
Additional information:

language: c++

VA_X.dll file version 10.2.1442.0 built 2006.03.07
VAOpsWin.dll version 1.3.2.4
VATE.dll version 1.0.4.15
DevEnv.exe version 8.0.50727.42
msenv.dll version 8.0.50727.42
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.3790.1830
WindowsNT 5.2 Build 3790 Service Pack 1
Single processor

Platform: Win32
Stable Includes:
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\include;
C:\\Program Files\\Microsoft Platform SDK\\Include;
C:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\include;
C:\\wtl80\\include;

Library Includes:
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\crt\\src;

---------------------------------
Fix it, plz... thx...
9   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Apr 02 2006 : 5:15:29 PM
appologies for the delay. i have found the description i wanted:

A base class may also be inherited as "protected" by a derived class. When this is the case, public and protected members of the base class become protected members of the derived class.

case=1111
feline Posted - Mar 27 2006 : 5:47:13 PM
i very rarely use protected in my C++ class trees, so i have tried compiling this with VS2003. for an instance of classB the function classB::public_methodA() is not available, you are right.

however is this because it has become protected or private? off hand i do not remember. i need to locate a book and check the rules for this. certainly there is a bug here though. as soon as i have pinned down what should be happening i will put in a bug report.
Lucky Luck Posted - Mar 23 2006 : 6:11:47 PM
All that I want is to see only the available members of current object...

quote:
if you move the mouse over the listbox you can filter it to only show you public members.


Even when I filter members, method "public_methodA" is visible...
but it's not available, and it's protected methhod for "classB"...
feline Posted - Mar 23 2006 : 4:03:21 PM
i see now. the basic problem is friend classes, plus code that you are still writing. VA cannot assume that the code it is helping you with is 100% complete and valid. as a result it cannot be to clever in trying to help.

the answer here is shown by this screen shot, which i get using your example on b. in the bottom function:



notice that the private members have an icon indicating that they are private. secondly if you move the mouse over the listbox you can filter it to only show you public members.
Lucky Luck Posted - Mar 22 2006 : 6:17:48 PM
In this sample, public_methodA presents as public method in VA MemberList, but this is not the case...
You are right... if uncomment one string, all will be correct...

Probably I want an impossible... from VA... =)

class classC
{
public:
	classC(){}
	void foo();	
};

class classA
{
public:
	classA(){}

	void public_methodA(){}
private:
	void private_methodA(){}
};

class classB : protected classA
{
public:
	classB(){}
	//friend void classC::foo(); 
	
	void public_methodB(){}
private:
	void private_methodB(){}
};

void classC::foo()
{
	classB b;
	b.public_methodA();
}
feline Posted - Mar 22 2006 : 5:22:16 PM
could you post just a few lines of code to show what you mean? remember that VA does not know if you have access to the private members or not. some times i have to use friend classes, and access private members of class A from class B.
Lucky Luck Posted - Mar 19 2006 : 7:17:17 PM
Even if I`ll specify to show only the public
members in popup listmember menu
(by clicking on popup toolbar button),
all public members of a base class will be visible, but
my class is protected or private inherited...

And I think that it's a bug...
Lucky Luck Posted - Mar 18 2006 : 5:51:03 PM
You are right, but
it is to be regretted that is by design...

suggestion:
if possible, could you make it in following versions... optionally...

--------
I apologise for my English...
support Posted - Mar 18 2006 : 5:14:22 PM
Can you explain the problem a bit more?

In case you are wondering, private members are included in member listboxes when not in a class. This is by design.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000