0

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. \u000d\u000a'。

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.

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.