tenho seguinte código winui3 xaml c++ <Grid> <Grid x:Name="AppTitleBar" Height="35"…
- User
tenho seguinte código winui3 xaml c++
void winrt::DataIntegrityTools::implementation::MainWindow::AppTitleBar_PointerPressed(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::Input::PointerRoutedEventArgs const& e) { Microsoft::UI::Input::PointerPoint currentPoint = e.GetCurrentPoint(nullptr);
if (currentPoint.Properties().IsLeftButtonPressed()) { auto windowNative{ this->m_inner.as<::IWindowNative>() }; HWND hWnd{ 0 }; windowNative->get_WindowHandle(&hWnd); if (hWnd) { SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0); } }}
recebo erro ao compilar
Erro C3779 'winrt::impl::consume_Microsoft_UI_Input_IPointerPointwinrt::Microsoft::UI::Input::IPointerPoint::Properties': uma função que retorna 'auto' não pode ser usada antes de ser definida
- Assistant
It seems the error occurs because the compiler cannot find the definition of the
Properties()method used in your code since it's possibly missing the necessary header file that includes the implementation of this method.In C++, when a function returns
autowithout a trailing return type, the compiler needs to see the function's definition before it is used so it can deduce the return type. If the function is only declared but not defined, or if the definition isn't visible to the compiler at the point of use, you will get an error like the one you're seeing.