Solution:使用Shockwave Flash Object控制項的時候提示:未能匯入 Activex控制項,請確保它已正確註冊!

來源:互聯網
上載者:User

轉載自:Solution:使用Shockwave Flash Object控制項的時候提示:未能匯入 Activex控制項,請確保它已正確註冊! 

Mysolution:

Microsoft Windows XP [版本 5.1.2600]
(C) 著作權 1985-2001 Microsoft Corp.
C:/Documents and Settings/LoveHSL>regsvr32
C:/Documents and Settings/LoveHSL>regsvr32 flash9c.ocx

上面的註冊嘗試沒有成功,然後我去搜尋了一下該控制項的位置,重新註冊
C:/Documents and Settings/LoveHSL>cd C:/WINDOWS/system32/Macromed/Flash
C:/WINDOWS/system32/Macromed/Flash>regsvr32 flash9c.ocx
C:/WINDOWS/system32/Macromed/Flash>

Other ref Resources:
No.1
Unable to add Flash 8 control in VS2005 - Tentative workaround...
OK - this has been causing me problems for the last day or so and I've managed to come up with a tentative workaround.  When you attempt add the Shockwave Flash Object (Version 8) to a form in a new or existing project - the IDE presents the message 'Failed to import the ActiveX control.  Please ensure it is properly registered'.  Checking out MSDN Product Feedback centre - this issue has been reported as a 'bug' and as of typing this message it is unresolved.
Other indicators can be found in the Error-List (under the Warnings Tab)...
Could not resolve dependent COM reference "stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".   Failed to create the wrapper assembly for type library "AxShockwaveFlashObjects". Exception of type 'Microsoft.Build.Tasks.ComReferenceResolutionException' was thrown. The referenced component 'AxShockwaveFlashObjects' could not be found. Failed to create the wrapper assembly for type library "AxShockwaveFlashObjects". Exception of type 'Microsoft.Build.Tasks.ComReferenceResolutionException' was thrown. Now my jaded logic resolves the problem to simply being an issue with Visual Studio's 2005 ability to create an appropriate COM wrapper for the Flash Control (yes, I know that's one of the messages above - but I worked this out before noticing the above - so there).  So - to the workaround...
Close your project and then copy the 'AxInterop.ShockwaveFlashObjects.dll' file into your project's '/obj/Debug' directory.  OK - what happens if you haven't got this file?  Well, you can either the copy generated on my computer from here or use the 'AxInterop.ShockwaveFlashObjects.dll' file from a VS2003 project - harvested from the appropriate 'obj' directory.  Once completed, reload the project and attempt to add the control again and that should be it!
Now I've tried both and whilst both work - there is a difference on my computer of 11Kb between the two versions, the VS2005 linked above being 17Kb and the VS2003 version being 28Kb.  
So - if that isn't a big enough disclaimer for you - I don't know what else is. So be careful, etc..  Hopefully, this workaround will work for you as well as it did for me.  Note: in this instance - if this workaround did or didn't work for you - please feel free to add your comments...
No.2
VS .NET 2005 C# 中添加 flash 控制項
在VS2005 C# 中添加flash8.ocx,出現錯誤提示,這可能是VS2005 C# 本身的BUG,可以參看這篇文章(很厲害哦):
http://blogs.vbcity.com/drydo/archive/2005/12/07/5731.aspx
可以這樣:
if (
  “未能匯入 activex 控制項,。請確保它已正確註冊。”
or
  'Failed to import the ActiveX control. Please ensure it is properly registered'    
)
{
  下載檔案;
  將它放在本專案檔夾下的"obj/Debug"目錄中;
  引入該檔案;  
  }
現在將flash控制項拖到form中就不會出錯了。
  我寫這段文字的方式模仿程式設計語言,只有一個目的,看起來舒服。呵呵。其實人類常用的語言和機器語言總有一天會消失界線的,適者生存。
No.3
搞定奇怪的FLASH OBJECT
搞定奇怪的FLASH OBJECT 作為一名新手,當然想個平淡無味的表單增添點樂趣,FLASH就是我的首選.
註冊成功FLASH8.OCX以後,試圖從工具列裡把它拖出來,卻引發一系列奇怪
的錯誤:
   快顯視窗“未能匯入activex控制項。請確保它已正確註冊”。
錯誤欄顯示錯誤:  
警告   1   未能解析依賴 com 引用“stdole, version=7.0.3300.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a”。   project1  
警告   2   未能建立類型庫“axshockwaveflashobjects”的封裝程式集。引發類型為“microsoft.build.tasks.comreferenceresolutionexception”的異常。   axshockwaveflashobjects   project1  
警告   3   未能找到引用的組件“axshockwaveflashobjects”。未能建立類型庫“axshockwaveflashobjects”的封裝程式集。引發類型為“microsoft.build.tasks.comreferenceresolutionexception”的異常。
問題在哪呢?不知道!既然都引用了該OCX,就乾脆手動寫代碼把控制項執行個體化,
把他載入到表單看能否實現!沒想到居然成功了!
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FlashPlayer));
            AxShockwaveFlashObjects.AxShockwaveFlash flashax = new AxShockwaveFlashObjects.AxShockwaveFlash();
            
            flashax .Enabled = true;
            flashax.Location = new System.Drawing.Point(0, 0);
            flashax.Name = "ax";
            flashax.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("flashax.OcxState")));
            flashax.Size = new System.Drawing.Size(this.Width , this.Height);
            flashax.TabIndex = 0;
            flashax.UseWaitCursor = true;
            this.Controls.Add(flashax);
這樣子做也覺得太麻煩,把上面的方法用來做自訂群組件,就實現了在表單上的任意拖動,
            flashax.Show();
Re: 搞定奇怪的FLASH OBJECT 我用的是VS2005 Express,
Express版關閉了加值介面(Add-In API),就是不能調用另外安裝的第三方編寫的API,這才是影響最大的關鍵。所以出現了上面的莫名奇妙的錯誤,但我又用最普通的辦法搞定了,有點鬱悶
Re: 搞定奇怪的FLASH OBJECT 可以認為是VS2005 Express搞怪,而不是axFLASH 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.