microsoft / microsoft/WindowsAppSDK-Samples
how to register WindowsApp runtime classes?
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 1k
- Forks
- 335
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 8
Description
I have following code, it's the short version of the sample squares, it compiled, but failed with 80040154(REGDB_E_CLASSNOTREG) which means the runtime classes of WindowsApp is not registered. I've installed WindowsAppSDK 1.3 from this link. It seems that the installer did not register it. So, my question is how to register it manually?
#include <winrt/base.h>
#include <winrt/Microsoft.UI.Windowing.h>
#include <winrt/Microsoft.UI.Dispatching.h>
#include <windows.h>
#pragma comment(lib, "windowsapp")
using namespace winrt;
using namespace Microsoft::UI::Windowing;
using namespace Microsoft::UI::Dispatching;
/*
cl /nologo /EHsc /Zi /std:c++latest /Iapiexp/winui3 winui3.cpp /link /subsystem:console /debug
*/
int WinMain(HINSTANCE,HINSTANCE,PSTR,int) {
winrt::init_apartment(winrt::apartment_type::single_threaded);
try {
auto appWindow = AppWindow::Create();
appWindow.Title(L"Squares");
appWindow.Show();
auto ctl = DispatcherQueueController::CreateOnCurrentThread();
auto queue = ctl.DispatcherQueue();
queue.RunEventLoop();
} catch(hresult_error e) {
printf("winui3 0x%x\n",int32_t(e.code()));
}
}
int main() {
return WinMain(nullptr,nullptr,nullptr,0);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the minimal C++ program shown in the issue after installing Windows App SDK 1.3 from the linked installer, and confirm where 80040154 occurs. Start by checking the runtime-class deployment and registration requirements for this installation method. Done means documenting the supported registration or deployment steps, or clarifying that the installer is not sufficient for this scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100