Step 2 - Import from Microsoft Visual Studio Approach

If you are working with Microsoft Visual Studio and have an environment where you can compile your code, Extract from Makelog is the easiest and most precise approach for setting up your project. But if you can't compile but still have Microsoft Visual Studio (MSVC) projects/solutions already defined for your software, Import from Microsoft Visual Studio offers an easy way to specify your source code and how to analyze it. The Microsoft Visual Studio approach extracts the file and preprocessor flag information directly from the .vcxproj, .vcproj or .dsp file created by Visual Studio. For solutions (called workspaces prior to the .NET version), .sln or .dsw files are read.

2a. Specify that you're adding a new data source

Open the Data Sources dialog (Project > Data Sources). To specify that you wish to add a new data source into the project rather than modify the settings for an existing data source, choose `+ new data source' under the Data Sources selector on the left side of the dialog. As this is a new project, and there are no existing data sources to modify, this is indeed the only choice available.

2b. Select the MSVC project or MSVC solution-based approach

For the rest of step 2, you'll be working on the right side of the Data Sources dialog. At the top, in the menubutton labeled `Select Data Source Type', select one of the [Source Files][Microsoft Visual Studio] alternatives. Use MSVC Project to load in the files associated with one specific project. Use MSVC Solution / Workspace if you want to load in the whole solution (called a workspace in older versions of Visual Studio).

2c. Specify the version of MSVC being used

To the right of the Type field, specify which version of MSVC you are using. This selection causes other parts of the dialog to change, since the various versions of MSVC use different file types to store information about the project.

2d. Specify the location of your MSVC project / solution file

Imagix 4D will process a specific file type for information about your code. That file type will vary depending on your selections for Type (Project or Solution) and for MSVC Version.

For example, if you've selected MSVC Project and are using Visual Studio 2010 or later, the associated file type is a .vcxproj file. In the resulting .vcxproj File field, enter the full path name of the .vcxproj file generated for your project by MSVC. Typically, this is located in the top-level MSVC project directory, and is named project.vcxproj.

2e. Specify any directories containing pre-compiled headers

When pre-compiled headers are used, information about the include directories containing the original header files, from which they are compiled, may not be available in the MSVC project settings. In this case, you need to explicitly specify these directories so that the Imagix 4D analyzer knows where to look for the header files.

In the Options field, enter the directory names using the -I (or -S) syntax `-Idirname' for each directory containing the header files. You may enter as many -I's as required. Do not put a space between the -I and the following directory name. Put a space between the name and the next -I.

2f. Specify which MSVC project configuration you want to examine

In the Configuration combobox, select the configuration of Visual Studio project that you want to build. Leaving the selection as (default) will result in the current configuration of the MSVC project to be analyzed whenever the Imagix 4D project's data is regenerated. This combobox is not available for solutions, where the current configuration is always used.

2g. Select your compiler configuration file

In the Compiler & Target combobox, select the compiler configuration file that you set up in step 1. Normally, this will be msvc_win. If you haven't yet configured the msvc_win.inc configuration file and you've installed Visual Studio and its system headers in non-default locations, strongly consider doing so now. The alternative is to use the default `msvc_win' and to explicitly specify the location of the MSVC system headers in the Options field, just as you did for any pre-compiled headers (step 2e).

2h. Start the analysis process

When you're ready to analyze your code, click Add Data Source at the bottom of the dialog.