Click here to Skip to main content
15,907,493 members

Comments by Vicente Flich (Top 6 by date)

Vicente Flich 17-Apr-24 4:10am View    
I got it! The correct way is an IVector<IInspectable>, not IVector<hstring>:

winrt::Windows::Foundation::Collections::IVector<IInspectable> l = single_threaded_vector<IInspectable>();
l.Append(box_value(L"Opcion1"));
l.Append(box_value(L"Opcion2"));
e.ItemsSource(l);

I put here for anyone with the same problem.
Vicente Flich 16-Apr-24 4:19am View    
Thanks Andre for your support. This seems to be in the right direction, the ItemSource expects an IInspectable, butnow I cant compile because SuggestionSource is an abstract class. I'm thinking implement another control less complicated, maybe a ComboBox...
Vicente Flich 13-Apr-24 13:38pm View    
Thaks Andre, I tried so, but still they crash in the same line e.ItemsSource(l) with and unhandled exception ("Interface not compatible").
Vicente Flich 26-Jan-24 2:40am View    
But, I don't understand this is the problem, simply I want two windows in the same instance. If I code the same but in two events separately:

void MainWindow::ClickButton1(IInspectable const&, RoutedEventArgs const&)
{
w1 = Window();
}
void MainWindow::ClickButton2(IInspectable const&, RoutedEventArgs const&)
{
w2 = Window();
}

They work and create two windows without error. Why cannot do it in the same event handler?
Vicente Flich 3-Oct-23 8:34am View    
Yes, thank you, but the code is generated by WinUI3, and I can't modify it. The question is how to configure the project to force the WinUI 3 to generate code in MBCS from .xaml files.