我在Windows Server 2008上使用Visual Studio 2010在C#中构建应用程序,应用程序是使用directshownet直接显示在.NET包装程序来访问系统的Web摄像头让视频流,但应用程序生成此错误检索具有CLSID {C1F400A0-3F08-11D3-9F0B-006008039E37}的组件的COM类工厂失败,原因是出现以下错误:80040154
Retrieving the COM class factory for component with CLSID {C1F400A0-3F08-11D3-9F0B-006008039E37} failed due to the following error: 80040154.
源代码如下
public Capture(int iDeviceNum, int iWidth, int iHeight, short iBPP, Control hControl)
{
DsDevice[] capDevices;
// Get the collection of video devices
capDevices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
if (iDeviceNum + 1 > capDevices.Length)
{
throw new Exception("No video capture devices found at that index!");
}
try
{
// Set up the capture graph
SetupGraph(capDevices[iDeviceNum], iWidth, iHeight, iBPP);
//// tell the callback to ignore new images
m_PictureReady = new ManualResetEvent(false);
}
catch
{
Dispose();
throw;
}
}
的代码抛出每当它到达这条线时的错误
SetupGraph(capDevices[iDeviceNum], iWidth, iHeight, iBPP);
请人帮助我,我用Google搜索,但无法找到一个解决方案
嗨, 您收到的COM错误是“Class Not Registered”错误。这可能有很多原因tbh;但一些常见的是: - COM对象确实未注册,因此无法创建 - COM对象具有其他不可用的依赖项。 - 混合64位和32位要求(.Net 64位,32位COM组件)。 –
谢谢,我已经能够解决这个问题,它像directshow.net需要一个不在我的Windows服务器上的qedit.dll,我下载了DLL并使用了regsvr32来注册,并且我停止接收错误 –