-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about Application::Start #51
Comments
Windows.UI.Xaml.Application takes a delegate as its argument. The Lambda is converted to that. In the callback you create your app object. |
Yes, but the App object doesn't seem to go anywhere, from the looks of it the object should die just as soon as it returns from I reckon that there should only be one App object within the application and so I'm figuring that it might be implemented in a singleton pattern with a static data member somewhere? I just find the
to be a little unintuitive and confusing. Perhaps have a differently named function to make and register the App objekt, maybe something like Just my thoughts, and I might have misunderstood things. |
When you create a Windows UI XAML Application, the constructor does not return. Instead it ends up in CoreDispatcher::ProcessEvents. What I'm saying is that make<App> will not return (until the App closes.)
Edit: Remove e-mail spew
|
Aha that makes a lot more sense! Thanks smj389 for clarifying that. If I could make a suggestion, maybe have a function named |
The XAML startup model is a bit odd because if you only look at WinMain it seems as if the XAML framework never gets a reference to your App class, but keep in mind that your App class derives from the XAML Application class. This causes the Application constructor to run, which is the way that the XAML framework discovers that the app is ready for launch. |
Thanks for the information and for the good work on cppwinrt! |
Hello, this is not an issue, just a question. I've just started to playing around with cppwinrt and I started with the sample project "XamlCode".
I'm a little bit confused about the following code found in
wWinMain
:This lambda seems to create an instance of
App
but it is not returning it to the caller.My Question: How is the function
OnLaunched
and other functions likeOnWindowsCreated
andOnActivated
getting called?I'm just curious.
Thanks for the cppwinrt initiative, it is really needed in my opinion.
The text was updated successfully, but these errors were encountered: