Giter VIP home page Giter VIP logo

regfree_winrt's Introduction

Registration-free WinRT Samples

This repo contains two samples (C# and C++) demonstrating how to use Registration-free WinRT (a new feature in Windows Builds 18309+) to reference a C++ Windows Runtime component in a non-packaged desktop app. More details can be found in each sample.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

regfree_winrt's People

Contributors

dfields-msft avatar manodasanw avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

regfree_winrt's Issues

Is there a way to use the reg-free activation if one doesn't own the process?

From the instructions outlined in the sample README, it looks like to leverage this registration free mechanism, one needs to create the process - app - manifest and supply the WinRT activation class mapping in there.
But, how if I don't own the process, therefore unable to create or edit the app manifest?

Here's one scenario I'm faced with:
I have a C++ DLL that is loaded as a COM component by an external process that I don't own.
And from my C++ assembly, I would like reference a WinRT component written in C# and I can't figure out how to activate the runtime classes; is there any way to accomplish this?
I attempted to create a manifest for my C++ component - with a .dll.manifest extension - but that doesn't seem to work...

Can this be done with a reg-free free mechanism?
Thanks!

How can I use this kind of mechanism from an dotnet dll rather than a dotnet exe?

I have tried this way to invoke my cpp winrt dll from other c# assembly with a test C# exe ,but i have to let my C# exe module to depend on this cpp winrt dll and add a manifist file and add a reference of VCRTForwarders or it will cause a C# System.TypeLoadException. So can I use this invoke machanism from a standalone C# assemly ? Or I didn't use it correctly?

WinRT component not found

I built both the WinRT component and the C# sample. Clicking on the button causes this exception:

System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)

I'm on Windows build 18362.239.

Getting error ‘The type 'User Control' was not found’

Using Windows Runtime activation mechanism( Registration-free WinRT ), a User Control class can be exposed and loaded into the MFC application for modernizing purpose. But when using another user control of same namespace in the User Control XAML that is hosted over MFC application, it crashes immediately at startup and throwing the following exception.
‘The type 'User Control' was not found’
It is possible to access the other user control class's properties from the C++ file of main User Control, so it seems like an issue while trying to access from XAML only.
How do we can handle “The type 'User Control’ was not found.” exception in Registration-free WinRT?
Reference links :
https://blogs.windows.com/windowsdeveloper/2019/04/30/enhancing-non-packaged-desktop-apps-using-windows-runtime-components/
https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/host-custom-control-with-xaml-islands-cpp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.