2012-06-18 194 views
19

我想使用應用程序,應用程序工作正常,我試圖編輯應用程序中的現有項目。當點擊編輯時出現以下錯誤,「類未註冊(異常從HRESULT:0x80040154(REGDB_E_CLASSNOTREG))」

System.Runtime.InteropServices.COMException was unhandled 
    Message="Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))" 
    Source="System.Windows.Forms" 
    ErrorCode=-2147221164 
    StackTrace: 
     at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid) 
     at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid) 
     at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid) 
     at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid) 
     at System.Windows.Forms.AxHost.CreateInstance() 
     at System.Windows.Forms.AxHost.GetOcxCreate() 
     at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state) 
     at System.Windows.Forms.AxHost.CreateHandle() 
     at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 
     at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 
     at System.Windows.Forms.AxHost.EndInit() 
     at bulk_lister.frm_edititem.InitializeComponent() in New Bulklister\new bulklister\bulk_lister\bulk_lister\frm_edititem.designer.cs:line 4248 
     at bulk_lister.frm_edititem..ctor(Int32 userid, Int32 intListingId) in New Bulklister\new bulklister\bulk_lister\bulk_lister\frm_edititem.cs:line 187 
     at bulk_lister.parent_form.funEditItem_fromrghtclktoolStrip_edititm() in New Bulklister\new bulklister\bulk_lister\bulk_lister\parent_form.cs:line 1313 
     at bulk_lister.parent_form.rghtclktoolStrip_edititm_Click(Object sender, EventArgs e) in New Bulklister\new bulklister\bulk_lister\bulk_lister\parent_form.cs:line 1233 
     at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) 
     at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e) 
     at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) 
     at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) 
     at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) 
     at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) 
     at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) 
     at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 
     at System.Windows.Forms.Control.WndProc(Message& m) 
     at System.Windows.Forms.ScrollableControl.WndProc(Message& m) 
     at System.Windows.Forms.ToolStrip.WndProc(Message& m) 
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 
     at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) 
     at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) 
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) 
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 
     at System.Windows.Forms.Application.Run(Form mainForm) 
     at bulk_lister.Program.Main() inNew Bulklister\new bulklister\bulk_lister\bulk_lister\Program.cs:line 17 
     at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 
     at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) 
     at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel) 
     at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() 
     at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData) 
     at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext) 
     at System.Activator.CreateInstance(ActivationContext activationContext) 
     at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone() 
     at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
     at System.Threading.ThreadHelper.ThreadStart() 
    InnerException: 

它與我與我的應用程序一起使用的Dll文件。我曾嘗試使用regsvr32註冊此dll文件,但我無法做到這一點。

DLL:AxInterop.DHTMLEDLib.dll & Interop.DHTMLEDLib.dll 

任何人有這個例外的想法?

+1

http://msdn.microsoft.com/en-us/library/aa663363.aspx –

+0

漢斯,下載此http: //www.microsoft.com/en-us/download/details.aspx?id=8956從你的鏈接中解決了我的問題是一樣的。 ...謝謝 – RustyH

+0

請問如何解決它? –

回答

13

這可能不是解決您的問題,但建議以防萬一(我知道我遇到過類似的問題,但沒有與.NET應用程序)。

如果您在64位機器上,有 regsvr32.exe文件; 一個在\Windows\System32 而另一個在\Windows\SysWOW64

您無法註冊32位版本的64位COM對象,但反之亦然。我想嘗試既regsvr32.exe文件註冊您的DLL明確(即輸入「C:\Windows\System32\regsvr32.exe /i mydll.dll」,然後「C:\Windows\SysWOW64\regsvr32.exe /i mydll.dll」),看是否有幫助?

+10

我已經嘗試了這個,但我得到錯誤「MYDll.dll已加載,但DllRegisterServer未找到」 對此的任何幫助? – user1462809

+4

@ user1462809調用regsvr32.exe沒有「/我」解決了我的問題。 –

+1

沒有幫助我,但我仍然想知道他們爲什麼沒有將其命名爲regsvr64.exe ...是否太難了? –

0

你需要註冊DHTMLED.ocx

+0

我已經註冊了DHTMLED.ocx,但它沒有恢復錯誤? – user1462809

32

什麼是你的應用程序的目標平臺?我認爲你應該將平臺設置爲x86,不要將其設置爲Any CPU

+0

在我的情況下,我將它設置爲x64,因爲它已經在x86 –

7

當我將框架從4.5更改爲4時,我得到了與vlc組件相同的錯誤。 但是,當我將平臺從任何CPU更改爲x86時,它都適用於我。

+1

這不是一個解決方案。 32位程序無法訪問超過3GB的內存。 – ThunderGr

1

[HRESULT:0x80040154的(REGDB_E_CLASSNOTREG))

只是看着它聽起來就像是沒有正確註冊一個或多個您引用的組件,或者一個或多個它們的依賴關係的消息。

如果您知道它是哪個組件,您可以使用regsvr32.exe進行註冊,只需打開命令提示符,轉至組件所在的目錄並鍵入regsvr32 filename.dll(假設它是一個dll),如果它工程,嘗試再次運行代碼,否則回到這裏與錯誤。

如果您不知道它是哪個組件,請嘗試重新安裝/修復GIS軟件(我假設您已經安裝了一些包含您嘗試使用的組件的GIS軟件)。

+0

我得到這個錯誤...模塊AxInterop.ShockwaveFlashObjects.dll被加載,但沒有找到入口點DLLRegister服務器。確保它是一個有效的DLL或.ocx文件這個DLL保存在我的項目bin文件夾..如何解決這個問題? – Vijayaraghavan

2

東西,我偶然發現在今天的我知道是工作的罰款與我的VS2013項目一個DLL,但與VS2015:

轉到:Project -> XXXX Properties -> Build -> Uncheck "Prefer 32-bit"

這個答案的方式逾期,可能不會做任何好的,但如果你。但我希望這有助於某個人。

0

經過一系列嘗試後,我進入了一個簡單的解決方案。您可以嘗試重新安裝Adobe FlashPlayer的ActiveX插件。

1

我的修復是建立在Visual Studio配置管理平臺,並設置爲64

相關問題