Reprinted from:Solution: when using the Shockwave Flash Object control, the system prompts: ActiveX control cannot be imported. Please make sure it has been correctly registered!
Mysolution:
Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:/Documents and Settings/lovehsl> regsvr32
C:/Documents and Settings/lovehsl> regsvr32 flash9c. ocx
The above registration attempt failed. Then I searched the location of the control and re-registered it.
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 center-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 )...
Cocould 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 hereOr 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 shocould 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 disclaugh 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 # Add a flash Control
Add flash8.ocx to vs2005 C # And an error is prompted. This may be a bug in vs2005 C #. Please refer to this article (very powerful ):
Http://blogs.vbcity.com/drydo/archive/2005/12/07/5731.aspx
You can do this:
If (
"ActiveX control cannot be imported ,. Make sure it is correctly registered ."
Or
'Failed to import the ActiveX control. Please ensure it is properly registered'
)
{
Download an object;
Put it in the "OBJ/debug" directory under the project folder;
Introduce this file;
}
Now you can drag the flash control to form without any errors.
I write this text to imitate the programming language for only one purpose and it looks comfortable. Haha. In fact, the boundaries of common human language and machine language will disappear one day, and the fittest will survive.
No. 3
Handle strange flash objects
Handle strange flash objectsAs a newbie, of course, I want to add some fun to a dull and tasteless form. Flash is my first choice.
After successfully registering flash8.ocx, I tried to drag it out of the toolbar, but it caused a series of strange
Error:
In the displayed dialog box, the ActiveX control cannot be imported. Please make sure it has been correctly registered ".
Error bar:
Warning 1 the dependency com references "stdole, version = 7.0.3300.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a ". Project1
Warning 2 failed to create the packaging assembly for the Type Library "axshockwaveflashobjects. An exception of the type Microsoft. Build. Tasks. comreferenceresolutionexception is thrown. Axshockwaveflashobjects project1
Warning 3 the referenced component "axshockwaveflashobjects" cannot be found ". Failed to create the packaging assembly for the Type Library "axshockwaveflashobjects. An exception of the type Microsoft. Build. Tasks. comreferenceresolutionexception is thrown.
Where is the problem? I don't know! Since the OCX is referenced, you can simply manually write code to instantiate the control,
Load it to the form to see if it can be implemented! I did not expect it to succeed!
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 );
This operation is too troublesome. The above method is used for custom components to implement arbitrary drag on the form,
Flashax. Show ();
Re: handle strange flash objectsI use vs2005 Express,
The add-in API is disabled in Express, that is, the API written by a third party cannot be called. This is the key to the greatest impact. So I encountered an inexplicable error, but I used the most common method to solve it. It was a bit depressing.
Re: handle strange flash objectsIt can be regarded as vs2005 Express, rather than axflash.