locked
error C2248: 'Windows::UI::Xaml::Input::FocusManager::FocusManager' : cannot access private member declared in class 'Windows::UI::Xaml::Input::FocusManager

    Question

  • I'm playing with the Windows 8 Consumer Preview, building a XAML/C++ app and the compiler doesn't like this line:

        FocusManager^ focusManager = ref new FocusManager();

    I get the following error & I can't tell what's going on:

    error C2248: 'Windows::UI::Xaml::Input::FocusManager::FocusManager' : cannot access private member declared in class 'Windows::UI::Xaml::Input::FocusManager

    Help would be appreciated :)

    Saturday, March 03, 2012 7:21 PM

Answers

  • Hi Payzer,

    You don't need to (and can't) create a FocusManager object. Its only function is the static GetFocusedElement which you call on the base class:

    focusedControl = FocusManager::GetFocusedElement();

    --Rob

    Sunday, March 04, 2012 2:58 AM
    Owner