microsoft / microsoft/cppwinrt

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.

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

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

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.