我知道這個問題的通常原因與組件編譯到的平臺有關,並且我以前遇到過這個問題。然而,這是來自單個用戶的報告,並且在他嘗試打開對話以選擇文件或目錄時發生。我沒有使用任何花哨的組件,只是標準組件。在堆棧跟蹤的一個相關的線路有:COM類出廠錯誤80040154打開獲取目錄對話框
Retrieving the COM class factory for component with CLSID {DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7} failed due to the following error: 80040154. at System.Windows.Forms.OpenFileDialog.CreateVistaDialog() at System.Windows.Forms.FileDialog.RunDialogVista(IntPtr hWndOwner) at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner) at System.Windows.Forms.CommonDialog.ShowDialog() at ScruffyDuck.AirportDesignEditor.MainForm.getOpenFileInfo(String initialDirectory, String filter)
我搜索我的註冊表此CLSID與
%SystemRoot%\System32\comdlg32.dll
這是沒有一個驚喜,我想上來。我假設,因爲有許多其他用戶沒有這個問題,必須涉及到用戶設置。如果在這種情況下提出建議,我將不勝感激。
非常感謝
您的應用程序是否在'MTAThread'中運行?查找'main()'方法,然後查看它的屬性,應該是'[MTAThread]'或'[STAThread]'。 – Cipi
它在[STATThread]中一直是我們以前從未見過的。據我所知,它是由30,000左右的單個用戶報告的。 – ScruffyDuck