Home‎ > ‎My Notebook‎ > ‎Dev Notes‎ > ‎

C# & Flash

To add the "Flash" ActiveX control to the VS 2005 Toolbox:
  1. Right-click on the Toolbox, select "Choose Item" or "Add/Remove items..."
  2. Select the "COM Components" tab
  3. Scroll down to "Shockwave Flash Object" and make sure it's ticked
  4. Click OK
When I drag control onto form you may get the error...
 "Failed to import the ActiveX control. Please ensure it is properly registered."

Fix (from MSDN forums):

The reason that my ActiveX contol (and possibly other ActiveX controls from other parties, excluding some 'very simple' controls) was not insertable on a Visual Studio 2005 .Net Windows Form directly was because of 2005, and unlike its predecessor VS2003, does not automatically add the necessary and needed COM reference to the OLE Automation type library - stdole.tlb or stdole2.tlb.

To remedy this situation, before inserting your ActiveX control, add the OLE Automation COM reference to the project. To do this, from the Solution Explorer find the project in question and expand its tree item to reach the sub-item labeled 'References'. Right click that item and choose 'Add...' from the popup menu. A dialog box will show up. Go to the page on that dialog that is labeled 'COM' and from the list of COM type libraries on that page check the 'OLE Automation' library and hit Ok.


Comments