您的位置:首页 > 移动开发 > Objective-C

Solution:使用Shockwave Flash Object控件的时候提示:未能导入 Activex控件,请确保它已正确注册!

2007-08-02 15:51 746 查看
转载自: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 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐