declared public. After switching from .NET 1.1 to 2.0 (Visual Studio 2003 to
VS 2005), I'm now getting compiler errors like:
error C2248: 'MyHelperClass::MyStaticMethod' : cannot access private member
in class MyHelperClass
I haven't made any code changes in MyHelperClass or the class that calls it.
Any ideas as to why this no longer compiles in VS 2005? Here's a code example:
Class with static methods:
Expand|Select|Wrap|Line Numbers
- namespace Utils
- {
- public __gc class ConversionUtils
- {
- private:
- ConversionUtils(void);
- ~ConversionUtils(void);
- public:
- static int ConversionFunction1(int arg);
- static int ConversionFunction2(int arg);
- }
- }
Expand|Select|Wrap|Line Numbers
- int CallingClass::GetConvertedValue()
- {
- return Utils::ConversionUtils::ConversionFunction1(memberVariable);
- }
error C2248: 'Utils::ConversionUtils::ConversionFunction1' : cannot access
private member declared in class 'Utils::ConversionUtils'
utils.dll : see declaration of 'Utils::ConversionUtils::ConversionFunction1'
utils.dll : see declaration of 'Utils::ConversionUtils'