
Originally Posted by
-Franky-
@VanGoghGaming: XAML controls in conjunction with the "Windows App SDK" would be the next step. However, I'm afraid that the "Windows App SDK" is too complicated for VB6, since it's actually only intended for .NET. First, you need to install the "Windows App SDK" in 32-bit and/or 64-bit versions. For VB6, you need to copy the installed files of the "Windows App SDK" from the "C:\Program Files\WindowsApps" folder, because some winmd files are required there. Then you need to download the NuGet package "microsoft.windowsappsdk.[version number]" and unpack it with 7-Zip, for example, and copy the DLL "Microsoft.WindowsAppRuntime.Bootstrap.dll" into the VB6 project folder. The unpacked NuGet package also contains some winmd files that must be extracted using the .NET tool "winmdidl.exe" to access the included idl files. The "Windows App SDK" can then be initialized and used via the MddBootstrapInitialize API of Microsoft.WindowsAppRuntime.Bootstrap.dll. All of this together is simply too complicated.
Hey Franky, have you tried to see if WinUI 3 controls can be loaded using the "registration-free" method as described in this blog post?
I have tried it with a WinUI 2 control, such as the NumberBox for example, by copying the "Microsoft.UI.Xaml.dll" file in the current folder and updating the manifest:
Code:
<file name="Microsoft.UI.Xaml.dll">
<activatableClass name="Microsoft.UI.Xaml.Controls.NumberBox" threadingModel="both" xmlns="urn:schemas-microsoft-com:winrt.v1" />
</file>
Then the NumberBox control can be created successfully in code like this:
Code:
hRes = RoGetActivationFactory(StrRef("Microsoft.UI.Xaml.Controls.NumberBox"), VarPtr(IID_NumberBoxFactory), NumberBoxFactory)
Set NumberBox = NumberBoxFactory.CreateInstance
The object is valid, you can call its methods and set its properties but DesktopWindowXamlSource.Content simply refuses to render it. I am thinking that WinUI 3 controls behave differently in this regard since they don't need DesktopWindowXamlSource at all.