none
Shockwave Flash Object

    Question

  • how do we add a shockwave flash object to visual basic 2005 express edition without the message saying: Failed to import the active-x control. Make sure it is properly registered.

     

    Please help

     

    Thanks

    Monday, July 16, 2007 5:57 PM

Answers

  • To play flash file (.swf) on WinForm, here is a simple approach: Use the AxWebBrowser component.

     

    Right-click the ToolBox -> select 'Choose Items ...' -> Select the COM tab -> Select "Microsoft Web Browser"

     

    There should now be a Microsoft Web Browser control in the toolbox, drag it onto your form and specify .swf file.

     

        Me.AxWebBrowser1.Navigate("E:\VBproject\topic.swf")

     

     

     Please check this thread for detail.

     

    Thanks,

    Martin

    Wednesday, September 26, 2007 10:34 AM
  • GlueyMcGee,

     

    Please follow the steps that can help you to add Shockwave Flash Object correctly on your form in VB 2005 Express:

     

    1. In Solution Explore, right click References and choose Add Reference. In COM tab, add Shockwave Flash. I am using Windows XP, the TypeLib Version is 1.0, the path is C:\WINDOWS\system32\Macromed\Flash\. The file name is Flash9d.ocx.

     

    2. Right click Toolbox -> Click "Choose Items", in COM Components tab, choose Shockwave Flash Object, then you can see the control in the Toolbox.

     

    3. Drag and drop the Shockwave control on the form, you will get "Failed to import the ActiveX control. Please ensure it is properly registered." error message. Click OK.

     

    4. Right click the project name in Solution Explorer, choose "Rebuild". When the project rebuild succesfully, you are able to add the Shockwave control on the form this time.

     

    I tried this, the steps work well on my computer in VB 2005 Express Edition.

    Friday, July 20, 2007 9:08 AM

All replies

  • GlueyMcGee,

     

    1. Right Click your ToolBox - > Choose  Items then a Dialog will appear with Tabs. Select the COM tab and search of the Shockwave Flash Object contol in the list, when found, Select it and press ok. Now It'll appear in your ToolBox, Drag it to your form from the ToolBox Set the swf gile in Movie URl like C:\\dd.swf, see if other propertires are needed.

     

    2. In order to avoid the error message "Failed to import the activeX control", please install the latest version of Adobe Macromedia Flash Player (9.0 r28). The name and path of it should be "%systemroot%\system32\macromed\flash9c.ocx".

     

    Hope the step above can help you with the problem.

    Thursday, July 19, 2007 7:54 AM
  • i did all that but now there is a new much longer eror that appears:

    Failed to create component 'AxHost'. The error message follows:

    'System.Runtime.InteropServices.COMExeption................................................................ 

    etc...etc...
    Thursday, July 19, 2007 3:44 PM
  • GlueyMcGee,

     

    Please follow the steps that can help you to add Shockwave Flash Object correctly on your form in VB 2005 Express:

     

    1. In Solution Explore, right click References and choose Add Reference. In COM tab, add Shockwave Flash. I am using Windows XP, the TypeLib Version is 1.0, the path is C:\WINDOWS\system32\Macromed\Flash\. The file name is Flash9d.ocx.

     

    2. Right click Toolbox -> Click "Choose Items", in COM Components tab, choose Shockwave Flash Object, then you can see the control in the Toolbox.

     

    3. Drag and drop the Shockwave control on the form, you will get "Failed to import the ActiveX control. Please ensure it is properly registered." error message. Click OK.

     

    4. Right click the project name in Solution Explorer, choose "Rebuild". When the project rebuild succesfully, you are able to add the Shockwave control on the form this time.

     

    I tried this, the steps work well on my computer in VB 2005 Express Edition.

    Friday, July 20, 2007 9:08 AM
  • Thanks now it works
    Friday, July 20, 2007 6:37 PM

  • Thanks for your help. I found this post very helpful. However, I have not been able to fix the problem.

    I followed your instructions and now I can add the flash movie into my proyect, however, when I debug it I get 4 errors:

    Warning    1    Could not resolve dependent COM reference "stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".    WindowsApplication1

    Error    2    Failed to create the wrapper assembly for type library "AxShockwaveFlashObjects". Exception of type 'Microsoft.Build.Tasks.ComReferenceResolutionException' was thrown.    C:\Documents and Settings\camilog\Local Settings\Application Data\Temporary Projects\WindowsApplication1\AxShockwaveFlashObjects    WindowsApplication1

    Error    3    Type 'AxShockwaveFlashObjects.AxShockwaveFlash' is not defined.    C:\Documents and Settings\camilog\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Form1.Designer.vb    26    36    WindowsApplication1

    Error    4    Type 'AxShockwaveFlashObjects.AxShockwaveFlash' is not defined.    C:\Documents and Settings\camilog\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Form1.Designer.vb    51    44    WindowsApplication1


    I downloaded the last version of shockwave, but still doesn't work.

    Thursday, July 26, 2007 7:25 AM
  • errrg, it wont work 4 me i followed all the steps and it still tells me

    "  'System.Runtime.InteropServices.COMException (0x8004D73F): This is not a COM component.
        at System.Windows.Forms.Design.DocumentDesigner.AxToolboxItem.CreateComponentsCore(IDesignerHost host)
        at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)
        at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)
        at System.Windows.Forms.Design.OleDragDropHandler.CreateTool(ToolboxItem tool, Control parent, Int32 x,
     Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize, ToolboxSnapDragDropEventArgs e)'
    "
    what do I do?
    Friday, August 31, 2007 2:36 AM
  • I found it !! you must click on ShockWave flash at toolbar , then click on form and hold
    then drag and drop to create a rectangle !
    there is an important point to set URL :
    it must be like this -->  

    this.axShockwaveFlash1.Movie = Directory.GetCurrentDirectory() + "\\Banner.swf";
    Friday, September 21, 2007 7:55 PM
  • To play flash file (.swf) on WinForm, here is a simple approach: Use the AxWebBrowser component.

     

    Right-click the ToolBox -> select 'Choose Items ...' -> Select the COM tab -> Select "Microsoft Web Browser"

     

    There should now be a Microsoft Web Browser control in the toolbox, drag it onto your form and specify .swf file.

     

        Me.AxWebBrowser1.Navigate("E:\VBproject\topic.swf")

     

     

     Please check this thread for detail.

     

    Thanks,

    Martin

    Wednesday, September 26, 2007 10:34 AM
  • This is how I got around the message reported several posts above, namely:

    [ Failed to create component 'AxHost'.  The error message follows: 'System.Runtime.InteropServices.COMException....]

     

    1) Added reference to swdir.dll to project,

    2) For Toolbox, choose item... browse to swdir.dll (will add two items to toolbox, one with black/gray icon = Shockwave ActiveX Control, the other with red icon = SwInstaller Ctl Class)

     

    ** Dragging the control with the RED icon (SWInstaller Ctl) will generate the 'AxHost' error ****  Instead:

     

    3) Drag BLACK/Grey icon (Shockwave ActiveX Control) to Form.

    This will put a reference to AxSWDIRLib in the project reference

     

     

     

    NOTE: If you are inheriting a codebase, you may need to do the following at least once in your Visual Studio solution in order to view a form in design mode that has the Shockwave Control on it:

    Create a blank form and then drag the Active X Shockwave Control (NOT the Install Control with red icon below it, USE the GRAY  BOX icon one) on to a form.  This will put a reference to AxSWDIRLib in the project reference.  You can delete this form, but now open up your original form in Design mode.

     

     

    Friday, February 01, 2008 6:26 PM
  • Hello GuleyMcGee,

     

    Considering that many developers in this forum ask how to manipulate WebBrowser component (enabling flash, suppressing error messages, proxy support), rotate or flip images, my team has created a code sample for this frequently asked programming task in Microsoft All-In-One Code Framework. You can download the code samples at:

     

    VBWebBrowserWithProxy

     

    http://bit.ly/VBWebBrowserWithProxy

     

    CSWebBrowserWithProxy

     

    http://bit.ly/CSWebBrowserWithProxy

     

    With these code samples, we hope to reduce developers’ efforts in solving the frequently asked

    programming tasks. If you have any feedback or suggestions for the code samples, please email us: onecode@microsoft.com.

    ------------

    The Microsoft All-In-One Code Framework (http://1code.codeplex.com) is a free, centralized code sample library driven by developers' needs. Our goal is to provide typical code samples for all Microsoft development technologies, and reduce developers' efforts in solving typical programming tasks.

    Our team listens to developers’ pains in MSDN forums, social media and various developer communities. We write code samples based on developers’ frequently asked programming tasks, and allow developers to download them with a short code sample publishing cycle. Additionally, our team offers a free code sample request service. This service is a proactive way for our developer community to obtain code samples for certain programming tasks directly from Microsoft.

    Thanks

    Microsoft All-In-One Code Framework

    Thursday, March 24, 2011 10:40 AM
  • Hello Sir,

     

    How about in WebPage??

     

    Thanks in advance...

    Wednesday, November 09, 2011 5:18 AM
  • GlueyMcGee,

    U can add .swf object,huh? but cant use it...a error displaybox appears when u try to add it in ur form,,.So your simple solution....

    1st, u have to be sure that ur flash player is updated,or u have to update it online.

    2nd,download the shocwave player from adobe.

    3d,go to this site http://www.adobe.com/shockwave/welcome/

    4th,u will see a request on the upper side like(Shockwave needs ur permission to run.)

    5th,Now chose the option always run on this run.

    6th,Dont close that tab,wait.maybe u should be asked to install it.

    7th,Now wait until the shockwave player is loaded on that site..

    Complete...!!!!!! U CAN USE IT NOW..No error will be shown. 

    www.facebook.com/mahdir.kabir


    • Edited by Mahdir Thursday, July 12, 2012 5:23 AM
    • Proposed as answer by Mahdir Thursday, July 12, 2012 5:23 AM
    Thursday, July 12, 2012 5:22 AM