I want the window to have a frosted glass effect, so I use windowsAppSdk in my win32 program. but when running into this code:
#include <Windows.h>
#include <MddBootstrap.h>
#include <tchar.h>
#include <winrt/Windows.System.h>
#include <DispatcherQueue.h>
#include <WindowsAppSDK-VersionInfo.h>
LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
int WINAPI wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR pszCmdLine,
_In_ int iCmdShow)
{
HRESULT hr = CoInitialize(NULL);
winrt::init_apartment(winrt::apartment_type::single_threaded);
const PACKAGE_VERSION minVersion{};
hr = MddBootstrapInitialize2(
Microsoft::WindowsAppSDK::Release::MajorMinor,
Microsoft::WindowsAppSDK::Release::VersionTag,
minVersion,
MddBootstrapInitializeOptions_OnNoMatch_ShowUI
);
return 0;
}
It popped up with an error:
(caller: 00007FF88D149DC0) LogHr(1) tid(4784) 80040010 The object is not in any state of in situ activityMsg:[Bootstrap.Intitialize: Scanning packages for Major.Minor=1.0, Tag=, MinVersion=0.0.0.0] CallContext:[Initialize]
and
WinRT originate error - 0x80670016 : 'Unable to resolve package dependency conditions. u000du000a'。
I also installed the package
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.26100.1" targetFramework="native" />
<package id="Microsoft.WindowsAppSDK" version="1.5.240627000" targetFramework="native" />
</packages>
I tried changing the majorMinorVersion to 0x0001000.But it’s still the same error.
New contributor
feng lei is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2