Compartir a través de


Extern Element

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The Extern element references any external header (.h) files to merge with the .vsct file at compile time. The files to be merged must be on the Include path given to the VSCT compiler or referenced by an Include Element. The files may be other .vsct files or C++ header files.

Definitions in header files must be of the form "#define [Symbol] [Value]" The value may be another symbol if it is previously defined. Definitions may be used in conditional statements of command items. Any symbol not actually used will be discarded.

CommandTable Element
Extern Element

Syntax

<Extern href="stdidcmd.h" />  

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
href Required. The path to the header file:

href="stdidcmd.h"
Condition Optional. See Conditional Attributes.
language Optional. The default language of all <Strings> elements in the command table:

language="en-us"

Child Elements

Element Description
None. None.

Parent Elements

Element Description
CommandTable Element Defines all of the elements that represent commands — that is, menu items, menus, toolbars, and combo boxes — that a VSPackage provides to the IDE.

Example

<?xml version="1.0" encoding="utf-8"?>  
<CommandTable xmlns="https://schemas.microsoft.com/VisualStudio/2005-10-  
  18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">  
    <Extern href="C:\VSCore\vscommon\inc\vsshlids.h"/>  
    …  
  <Commands package="guidMyPackage">  
</CommandTable>  

See Also

Visual Studio Command Table (.Vsct) Files
How VSPackages Add User Interface Elements
Commands, Menus, and Toolbars