Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Private and protected inheritance
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Lucky Luck
New Member

7 Posts

Posted - Mar 18 2006 :  4:36:38 PM  Show Profile  Reply with Quote
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...

support
Whole Tomato Software

5566 Posts

Posted - Mar 18 2006 :  5:14:22 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

Lucky Luck
New Member

7 Posts

Posted - Mar 18 2006 :  5:51:03 PM  Show Profile  Reply with Quote
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...
Go to Top of Page

Lucky Luck
New Member

7 Posts

Posted - Mar 19 2006 :  7:17:17 PM  Show Profile  Reply with Quote
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...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 22 2006 :  5:22:16 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

Lucky Luck
New Member

7 Posts

Posted - Mar 22 2006 :  6:17:48 PM  Show Profile  Reply with Quote
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();
}
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 23 2006 :  4:03:21 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

Lucky Luck
New Member

7 Posts

Posted - Mar 23 2006 :  6:11:47 PM  Show Profile  Reply with Quote
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"...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Mar 27 2006 :  5:47:13 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Apr 02 2006 :  5:15:29 PM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000