Share via

What is wrong with this code

Vijayadithyan .N 121 Reputation points
2022-05-07T05:55:18.257+00:00

I ported an app from C++/CX to C++/WinRT, And the basic code is this (Excluding Main()):

class DirectXApp : public IFrameworkView
{. . .};
class DirectXAppSource : IFrameworkViewSource
{
virtual IFrameworkView : CreateView()
{
return new DirectXApp();
}
}

And these 2 errors show up:
Severity Code Description Project File Line Suppression State
Error C2664 'void winrt::Windows::ApplicationModel::Core::CoreApplication::Run(const winrt::Windows::ApplicationModel::Core::IFrameworkViewSource &)': cannot convert argument 1 from 'DirectXAppSource *' to 'const winrt::Windows::ApplicationModel::Core::IFrameworkViewSource &' CoreApp

Developer technologies | Universal Windows Platform (UWP)
Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.