0
votes

I am new to Windows universal app development. As per my knowledge Windows universal app can be made by using C++/CX , C# or JavaScript. But Microsoft force to do development by using C++/CX because it uses power of winRT much better than others. So i tried the development using C++/CX for Visual Studio 2015. I come to a topic of Navigation. To perform navigation in app there is one API
this->Frame->Navigate(TypeName(MySecondPage::typeid)). This API gives me a exception at runtime.

This is the detail scenario what i did. 1. I create project by named NavigationSample using C++/CX.

  1. Then i added new Basic Page of xaml for my Second view/ui and named it as MySecondPage.xaml

  2. Now on first page i.e. MainPage.xaml i added One button.

  3. On event of this button , lets say button_Click as event handler i wrote
    this->Frame->Navigate(TypeName(MySecondPage::typeid))

Here is the detailed code:

void NavigationSample::MainPage::button_Click(**Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)**

{

this->Frame->Navigate(TypeName(MySecondPage::typeid));

}

  1. This compile and build fine. But gives exception at runtime. (Same scenario works very fine with C#)

    So guys please help me how to resolve this issue? Thanks

1
"It gives an exception" is not an appropriate problem description.Hans Passant
It gives me following Exception: "Exception thrown at 0x000007777 in NavigationSample.windows.exe Microsoft C++ exception. HRESULT 0x0007777f parameter is incorrect. WinRT Information:dp"Sarthak mirajkar

1 Answers

0
votes

Here's a clue:

m_ptrSettingsPage->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]() {
            m_ptrSettingsPage->Frame->Navigate(Windows::UI::Xaml::Interop::TypeName(AnnuitiesPage::typeid));
        }));

Best wait for C++/wimRT