I have an UWP application that I would like to interface with another program (Wirecast). The approach suggested by Wirecast is to call the following code:
Type objClassType = Type.GetTypeFromProgID("Wirecast.Application");
_Wirecast = Activator.CreateInstance(objClassType);
When I call this code from UWP app I get the following error:
System.Runtime.InteropServices.COMException: 'Creating an instance of the COM component with CLSID {A416C15B-A073-4994-8DB5-87527A41B2FA} using CoCreateInstanceFromApp failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
I checked the CLSID and it appears correctly in the Registry Editor. I tried compiling for x64 and x86 configurations with the same results.
When I try compiling this example in WPF project it works as expected.
Is there any way to use this COM object with an UWP app?
Unfortunately this won't work as UWP runs in a sandbox and it cannot communicate with COM. If you want such functionality, you would have to create a local service via which would your UWP app communicate with the program or a Brokered Windows Runtime Component which has no limitations but will prevent your app from being published to Microsoft Store.
User contributions licensed under CC BY-SA 3.0