Here's the problem. I have a win32 (x86) program that has WinRT NuGet installed and working that needs to call a C# functions. I followed the instructions here and got everything working as a test C++/WinRT template app (see picture below). However, I followed these instructions to convert a C++ native console app and a C++ native desktop app. Neither of these projects can reference the WinRT Component project directly like the C++/WinRT template can. So I found the output .winmd
file and referenced that instead and got both native projects to build. But now I get a different error: REGDB_E_CLASSNOTREG Class not registered == 0x8000000c : A concurrent or interleaved operation changed the state of the object, invalidating this operation.
What's the difference between a converted C++ app and a C++/WinRT template app?
Which part lets the C++/WinRT app reference the WinRT Component directly?
For third-party NuGet packages, is this a possible method to use? Or perhaps I should look into C++/CLI wrappers for this? (I have no experience with C++/CLI wrappers)
Edit
For clarification between the two projects I'm comparing, one is a Windows Console Application (C++/WinRT)
which I think I got this option from the the WinRT VSIX extension. The other is the base C++ Console App
(Run code in a Windows terminal. ...) that would download the C++/WinRT NuGet package after startup.