我在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來註冊,並且我停止接收錯誤 –