Why i'm getting exception : Retrieving the COM class factory for component with CLSID class not registered?

I found a device in my usb guid number. And trying to use it in my program: In my program i'm using directshowlib

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using DirectShowLib; using DirectShowLib.BDA; using DirectShowLib.DES; using DirectShowLib.DMO; using DirectShowLib.Dvd; using DirectShowLib.MultimediaStreaming; using DirectShowLib.SBE; using System.Runtime.InteropServices; namespace Youtube_Manager { public partial class Elgato_Video_Capture : Form { IFilterGraph2 graph; ICaptureGraphBuilder2 captureGraph; IBaseFilter elgatoFilter; IBaseFilter smartTeeFilter; IBaseFilter videoRendererFilter; Size videoSize; string error = ""; public Elgato_Video_Capture() { InitializeComponent(); try { var capDevices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); //Set the video size to use for capture and recording videoSize = new Size(1280, 720); //Initialize filter graph and capture graph graph = (IFilterGraph2)new FilterGraph(); captureGraph = (ICaptureGraphBuilder2)new CaptureGraphBuilder2(); captureGraph.SetFiltergraph(graph); //rot = new DsROTEntry(graph); //Create filter for Elgato Guid elgatoGuid = new Guid("4d36e96c-e325-11ce-bfc1-08002be10318");//"39F50F4C-99E1-464A-B6F9-D605B4FB5918"); Type comType = Type.GetTypeFromCLSID(elgatoGuid); elgatoFilter = (IBaseFilter)Activator.CreateInstance(comType);

In the registry i found under: HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > ENUM i found the usb device by it's description so i know it is the one.

Then i copied the device Class GUID: 4d36e96c-e325-11ce-bfc1-08002be10318 But when i put it in my program i'm getting the exception on the line:

elgatoFilter = (IBaseFilter)Activator.CreateInstance(comType);

Retrieving the COM class factory for component with CLSID {4D36E96C-E325-11CE-BFC1-08002BE10318} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

System.Runtime.InteropServices.COMException occurred HResult=-2147221164 Message=Retrieving the COM class factory for component with CLSID {4D36E96C-E325-11CE-BFC1-08002BE10318} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Source=mscorlib ErrorCode=-2147221164 StackTrace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at Youtube_Manager.Elgato_Video_Capture..ctor() in d:\C-Sharp\Youtube-Manager\Youtube-Manager\Youtube-Manager\Elgato_Video_Capture.cs:line 51 InnerException:

How can i solve this exception ? The Guid is wrong ?

Category:c# Views:7 Time:2019-02-10

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.094 (s). 11 q(s)