Reputation: 175
This blog post about command line UWP apps says "The Executable is the name of your UWA app EXE, and the EntryPoint is the fully qualified name of your App class."
That makes sense for C# apps, but what about the C++/WinRT console UWP app template? The only code we have there is this:
int main()
{
// You can get parsed command-line arguments from the CRT globals.
wprintf(L"Parsed command-line arguments:\n");
for (int i = 0; i < __argc; i++)
{
wprintf(L"__argv[%d] = %S\n", i, __argv[i]);
}
wprintf(L"Press Enter to continue:");
getchar();
}
and the mainfest says:
...
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="UWPConsoleApp.App"
...
I called the project UWPConsoleApp, so that's what VS set as the entry point, but where is this class? Does the compiler generate it, is it some obscure vcruntime init code controlled by macros or something entirely different?
Upvotes: 2
Views: 1551
Reputation: 41057
Those manifest values are basically unused here, so don't worry about it. There's no difference in the Package.appxmanifest
for C++/CX vs. C++/WinRT.
The start-up differences are in your code entry-point:
// C++/CX
[Platform::MTAThread]
int __cdecl main(Platform::Array<Platform::String^>^ /*argv*/)
{
auto viewProviderFactory = ref new ViewProviderFactory();
CoreApplication::Run(viewProviderFactory);
return 0;
}
vs.
// C++/WinRT
int WINAPI wWinMain(
_In_ HINSTANCE /*hInstance*/,
_In_ HINSTANCE /*hPrevInstance*/,
_In_ LPWSTR /*lpCmdLine*/,
_In_ int /*nCmdShow*/
)
{
ViewProviderFactory viewProviderFactory;
CoreApplication::Run(viewProviderFactory);
return 0;
}
Upvotes: 4