Jump to content
  • Advertisement
Sign in to follow this  
mayag

[.net] migrating from Visual Studio .NET 2003 to Visual Studio 2005

This topic is 3760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I'd very grateful for your help with compilation error I get after migrating from Visual Studio .NET 2003 to Visual Studio 2005. class A is a managed class which contains pointer pPtr to unmanaged class as public member class B is a managed class, derived from A. In constructor of B there is an initialization of pPtr after migrating from Visual Studio .NET 2003 to Visual Studio 2005 I get a compilation error: cannot access a private member of class A (pPtr) I'm using Old Syntax. Thanks in advance, Maya

Share this post


Link to post
Share on other sites
Advertisement
If the member is really declared as public you shouldn't be getting that error. Are you sure it's actually public? The default is private if you don't specify the access level.

Share this post


Link to post
Share on other sites
I'm sure it's public. This error occured after convertion of project from Visual Studio .NET 2003 to Visual Studio 2005.

Share this post


Link to post
Share on other sites
unfortunately, I'm not allowed to publish the source code. If I have a chance I'll write an example.
thanks a lot for your responce

Share this post


Link to post
Share on other sites
1) There is unmanaged class Singleton:

class Singleton {

public:

static Singleton* GetInstance();

private:

static Singleton * m_s;
...
};


2) managed base class A:


public class _gc A {

public:

Singleton * m_a;

};


3) managed derived class B :

public class _gc B : public A {
...

};


B::B() : A()
{
m_a = Singleton :: GetInstance(); // COMPILATION ERROR : cannot access private member in A
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!