Custom runtimeclass App build fail #1936
-
Hi, I want to add some public function to App struct, and call from some page. I reduce my project to a simple sample code.
and call GetValue in MainWindow
build error message:
I can't find any related sample code. NuGet package version Packaging type Windows version IDE Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Have you included App.h in MainWindow.xaml.h or MainWindow.xaml.cpp? Unlike other Windows Runtime classes, the App class shouldn't be defined in metadata (IDL) as its internal to the project. Instead, use the get_self method to get a pointer to the instance of the implementation type and access it that way. |
Beta Was this translation helpful? Give feedback.
Have you included App.h in MainWindow.xaml.h or MainWindow.xaml.cpp? Unlike other Windows Runtime classes, the App class shouldn't be defined in metadata (IDL) as its internal to the project. Instead, use the get_self method to get a pointer to the instance of the implementation type and access it that way.