Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bug: Cannot winrt::box_value a wchar_t

Open
#1,566 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp
Domain
api

Research direction

Start by compiling the provided IDL with the Char property and trace the generated C++/WinRT code into winrt::box_value and the has_category assertion. Compare Char handling with other supported IDL types; done means the reproducible example compiles and the Char property can be exposed without the static assertion.

Written by the indexing model from the issue text.

Description

Version

No response

Summary

From this documentation, it should be able to expose a Char type from the idl, but doing this will cause a compile error:

        static_assert(impl::has_category_v<T>, "T must be WinRT type.");
Reproducible example

Use this idl

    [default_interface]
    runtimeclass MainPage : Windows.UI.Xaml.Controls.Page
    {
        MainPage();
        Char MyProperty;
    }
Expected behavior

Compiles

Actual behavior

No response

Additional comments

No response

Dominant language
C++
Stars
1.9k
Forks
281
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/cppwinrt

All issues in microsoft/cppwinrt

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.