Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x:Bind with cast fails to compile with C++ #10360

Open
HO-COOH opened this issue Feb 15, 2025 · 0 comments
Open

x:Bind with cast fails to compile with C++ #10360

HO-COOH opened this issue Feb 15, 2025 · 0 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@HO-COOH
Copy link

HO-COOH commented Feb 15, 2025

Describe the bug

Got

error C2665: 'winrt::to_hstring': no overloaded function could convert all the argument types

The exact same code works in C# project

Steps to reproduce the bug

  1. Create a new winui3 C++ project, use this xaml
    <StackPanel>
        <ComboBox x:Name="MyChoice" SelectedIndex="0">
            <x:String>A</x:String>
            <x:String>B</x:String>
        </ComboBox>
        <TextBlock Text="{x:Bind (x:String)MyChoice.SelectedItem, Mode=OneWay}" />
    </StackPanel>
  1. Build and observe the compile error

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.7 Experimental 3: 1.7.250127003-experimental3

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

@HO-COOH HO-COOH added the bug Something isn't working label Feb 15, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

1 participant