| Customize Help

Using MIL add-on to Visual Studio



MIL provides an extension to Microsoft Visual Studio users to assist in developing MIL applications. This includes a menu and toolbar added to Microsoft Visual Studio, as well as F1 contextual help and statement completion (IntelliSense) for projects written in C++, C#, or Visual Basic. MIL add-on to Visual Studio is automatically installed whenever MIL is installed on a computer with a supported version of Microsoft Visual Studio. To verify that the extension has been properly installed, open the Extensions and updates dialog box in Microsoft Visual Studio; MIL add-on to Visual Studio should appear in the list presented in the dialog box.

By default, all features of the MIL add-on to Visual Studio are enabled. In the MIL add-on to Visual Studio pane of the MILConfig utility (located by expanding the Benchmarks and Utilities item and selecting the MIL add-on to Visual Studio sub-item in the presented tree structure), you can enable or disable the features of the MIL add-on to Visual Studio. This pane provides a checkbox that indicates whether to enable the add-on. In addition, if the add-on is enabled, you can disable statement completion in any of the three supported languages. Disabling any of the checkboxes and clicking on the Apply button will disable those features. In this way, you can also install the add-on if it was not previously installed, which can be used if you install Microsoft Visual Studio after installing MIL and want to use the extension. Microsoft Visual Studio must be closed whenever changing the extension's settings.

MIL menu and toolbar

MIL add-on to Visual Studio adds a menu to Microsoft Visual Studio's menu bar called MIL. This menu allows you to access MIL tools, adjust your preferences, read documentation about the MIL add-on to Visual Studio, and change the settings of MIL add-on to Visual Studio in the MILConfig utility.

Additionally, you can add a toolbar to your Microsoft Visual Studio window that contains links to MIL tools. The toolbar is not visible by default. See the Microsoft Visual Studio help to add the toolbar. If you have installed both 32- and 64-bit MIL, the toolbar will open the version of the MIL tool based on what is specified in the Solution Platforms item. For example, if you have x64 as your Solution Platforms setting, clicking on a MIL tool will open the 64-bit version of that tool.

F1 contextual help

MIL add-on to Visual Studio provides F1 contextual help for MIL code. To see the MIL Reference page for a particular function, place your cursor on or highlight the function and press F1. This will open the MIL help file in a window that is part of the current Microsoft Visual Studio instance. Note that this help file will have the default saved settings (such as, MIL systems or Product settings) as that of the installed MIL Help and cannot save different (custom) settings.

To see the information for a specific MIL value, place your cursor on or highlight the value and press F1. The value must be used in the correct contextual location of its corresponding function and parameter. For example, if you want to see the description for the M_BACKGROUND_COLOR value of MdispControl(), M_BACKGROUND_COLOR must be passed to the second parameter of MdispControl(). Contextual help only works on MIL values (all values that begin with M...); it will not work on text strings (values encapsulated in MIL_TEXT) and user-defined variables or numerical values. If contextual help is requested for a value and the value cannot be found, the MIL Reference page for the function will be opened instead.

Contextual help can also be requested for MIL custom data types (for example, MIL_ID) or a portability function (for example, MosMain()). If you place your cursor or highlight a MIL custom data type or portability function, the help file opens the MIL custom data types, void pointers, extensions, and portability functions section earlier in this chapter.

Note that when you first open MIL Help with F1, you might need to wait a few moments before the help file opens. Also if you are opening the MIL Help for the first time, it might open the Customize MIL Help section of Chapter 0: About MIL help.

Statement completion

MIL add-on to Visual Studio provides statement completion to users writing MIL code in C++, C#, and Visual Basic. Statement completion makes developing with MIL easier by providing quick access to MIL functions and values through IntelliSense. Statement completion for MIL will work on any file that Microsoft Visual Studio recognizes as a C++, C#, or Visual Basic file.

When you start typing in a file for the supported languages in Microsoft Visual Studio, the IntelliSense session will display all MIL functions available. Alternatively, you can use Ctrl + Spacebar to start an IntelliSense session. To add a MIL function from the displayed list, highlight it and then press the Tab key.

If a function's parameter can take a MIL value as possible settings, IntelliSense can display a list of suggested MIL values that you can use. When an IntelliSense session is opened upon specifying a parameter setting in a MIL function, a tab will appear in the IntelliSense list called Suggested MIL values. If the Prioritize Suggested MIL Values item under Preferences in the MIL menu is enabled, this tab will appear by default. If it is not the default tab shown, click on the Suggested MIL Values tab or press Alt + . to bring up all the documented MIL values that can be used as a parameter setting. If you highlight an item in the displayed list, a tooltip will display the description for that MIL value, the installed MIL systems it supports, and any possible combination values (if available). If M_DEFAULT is available, it will be listed first. To add a MIL value from the displayed list, highlight it and press the Tab key.

Note that the descriptions in the help file might be more up-to-date than those presented in the IntelliSense tooltip.

If you start an IntelliSense session and a suggested value has a combination value available, IntelliSense will say (combinations available) next to the value's name and the tooltip will list the possible combination values.

If you select a value with combinations available and you type a +, you can start a new IntelliSense session that presents a list of the available combinations. Note, however, that if a combination value has combinations available, they will not be listed in a new IntelliSense session.

If the value of a parameter is dependent on the value of another parameter, you must specify the parameter on which it is dependent first. For example, possible values in MdigControl() for the ControlValue parameter are dependent on the setting of the ControlType parameter, so you must specify a value for the ControlType parameter for IntelliSense to present a list of the possible values for the ControlValue parameter.

IntelliSense will only suggest values for input parameters and for values listed in a table. Values that have not been formally documented (for example, a value mentioned in the release note of a MIL driver update) will not be displayed in IntelliSense. Any value that is not supported on the systems that you have installed will be filtered by default; to change this behavior, disable the Filter Suggested MIL Values by Installed Systems option under Preferences in the MIL menu.

Although values are suggested, values such as an integer value might be possible as a parameter setting, but are not listed in IntelliSense. See the appropriate reference page for more information.