MicrosoftDocs / winrt-api

WinRT reference content for developing Microsoft Universal Windows Platform (UWP) apps
Creative Commons Attribution 4.0 International
227 stars 495 forks source link

When can GetForCurrentThread return null? #1138

Open Mailosz opened 5 years ago

Mailosz commented 5 years ago

At least once this function returned me null. Why is that? When can it happen?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

rufw91 commented 4 years ago

I also have the same question.

rufw91 commented 4 years ago

Hey so I saw this the answer to: https://stackoverflow.com/questions/16477190/correct-way-to-get-the-coredispatcher-in-a-windows-store-app

Basically it returns null if not on UI thread.