How do I handle private virtual methods in (old syntax) 2005 (Express)?

  • Thread starter Thread starter Peter Oliphant
  • Start date Start date
P

Peter Oliphant

I got 2005 Express to prepare for the arrival of my company's MSDN full
version. Upon loading my project it was converted successfully, but did warn
me modifications would have to be done for it to compile (which I expected).
I then compiled, and got all the errors removed, and I was left with two
warnings.

Both warning regarded my using private (pure or otherwise) virtual methods
in a __gc class. I'm using old syntax (first things first) to put things in
context. One of the corrections I made was to put the '__abstract' in front
of each __gc abstract class (I hadn't expressed this explicitly before)
since the compiler complained about this (while 2003 did not).

Making these methods public does fix it. But, there are reasons to make
virtual methods private, why has this ability been taken away? Why can't a
virtual function be private in a __gc class? This makes absolutely no sense
to me, as this only has to do with external access. Why should any methd be
FORCED to be accessible by everybody, ESPECIALLY virtual methods?

Also, I see that trying to reduce the access in inherited functions is also
an error (i.e., even when one instantiates the method with actual code, it
must remain public in derived classes).

When I convert my code to the new syntax will I be able to make my virtual
methods private again?

[==P==]
 
Back
Top