locked
Deriving from class in WRC project results in "cannot access private member declared..."

    Question

  • My solution compiled until I added a new ClientManagerInfrastructure project and moved my UserPresenter class into it.  I now get the error that follows:

    1>c:\_data\dev\clientmanager\clientmanagerinfrastructure\userpresenter.h(11): error C2248: 'MvpVmWrc::MvpVm::PresenterBase::PresenterBase' : cannot access private member declared in class 'MvpVmWrc::MvpVm::PresenterBase'

    If I remark out the code segment pointed to by the top arrow (which is identical to the code pointed to in bottom arrow) then the solution will compile.  Am I missing something?  


    MCAD.NET C# - http://www.Global-webnet.com/Blog

    Saturday, August 25, 2012 11:58 AM

Answers

  • There is an explanation as to why this is occurring in this article:

    Ref classes and structs (C++/CX)

    "Inheritance of user-defined ref classes across .winmd files is not supported; however, a ref class can inherit from an interface that's defined in another .winmd file. You can create derived classes from a user-defined base ref class only within the same Windows Runtime component or Metro style app."

    Keeping them both in the same project will work as you have experienced.

    Thanks!


    David Lamb

    Monday, August 27, 2012 9:47 PM
    Moderator