Archive for the ‘Visual Studio’ Category

Our team uses Neutron inside our main product ReviewBasics. That is a really big Visual Studio 2005 solution (55+ projects), including several Neutron projects. In other words, our team is “building next generation Rich Internet Applications that combine Flash on the front-end and .NET on the server-side”, as the home page of Neutron website says.

Currently our flash front-end uses some quite big 3rd-party AS2 libraries which are referenced to Neutron projects (see the note below). The classes within the libraries participate in code complete operations, so it takes some time for IntelliSense database initialization while the project is loading.

Note: Neutron supports Zip reference feature that allows you to link an external library as a zip file, and Neutron automatically unzips and references classes within.

Actually, such possibilities are not needed for our server-side .NET part of the team. Most of them never touch the AS2.0 code. All they need is to compile this code while rebuilding the entire solution.

Well, that can be easily switched off. To disable IntelliSense database creation on project loading go to ‘Tools’ -> ‘Options’ in the main Visual Studio 2005 menu. Select ‘Projects and Solutions’ -> ‘Neutron Project Settings’ in the appearing Options dialog, and uncheck ‘Enable IntelliSense’ checkbox. Next time the projects will be loaded without IntelliSense initialization phase.

In addition, on this option page you can set the path, where MTASC compiler is located. That can be useful if you want to compile with HAMTASC instead. See How To: Substitute MTASC with HAMTASC tutorial.

Also, you can manage cache directory for ZIP references used in your Neutron project.



~ Dmitry

Read Full Post »

As I was preparing for tutorial of using SharpStyle Neutron to develop an ActionScript project and Windows Forms within one solution, I ran into the following issue: while there are a number of references on the web on how to use Flash OCX within Visual Studio 2003, there are only a handful of results related to Visual Studio 2005 and most of them document the problems that people are having.

Following the steps from this article (Macromedia – Developer Center Embedding Macromedia Flash Player in a C# Application) produce the following errors:

  • There is a popup stating that VS “Failed to import the ActiveX control.  Please ensure it is properly registered
  • If you examine Error List, under Warnings, you will see the following

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. 

I found the following Unable to add Flash 8 control in VS2005 – Tentative workaround blog post from 2005-12-07, but the instructions there didn’t work. After doing a few more searches I found the following forum page in French (translated page / original page)

Here is what needs to be done:

  • Open Visual Studio 2005 command prompt and execute the following:
    • aximp.exe -source “C:\WINDOWS\system32\Macromed\Flash\Flash9b.ocx”
  • This will generate the following files. Items in bold are the important ones:
    • AxShockwaveFlashObjects.dll
    • AxShockwaveFlashObjects.pdb
    • ShockwaveFlashObjects.dll
    • AxShockwaveFlashObjects.cs

  • In Visual Studio, add the references to the 2 dlls generated by aximp (I copied them from “C:\Program FIles\Microsoft Visual Studio 8\VC” to the root of the project): 

  • Add namespaces to the imports section

using AxShockwaveFlashObjects;
using ShockwaveFlashObjects;

  • And here is some sample code to display SWF
AxShockwaveFlash axShockwaveFlash = new AxShockwaveFlash();
axShockwaveFlash.Location = new System.Drawing.Point(50, 50);   

this.Controls.Add (axShockwaveFlash);
//this.Show(); // Avoids InvalidActiveXStateException.

axShockwaveFlash.Movie = "D:\\test.swf";
//* it is important to set Size after specifying Movie property
//* if Size is specified before, it is ignored
axShockwaveFlash.Size = new System.Drawing.Size(20, 20);


Read Full Post »