Add a property
Use the Add Property wizard to add a property to an interface in your project.
To add a property to your interface:
From the Visual Studio main menu, select View > Class view. In the Class View pane, expand the project node to display the interface you want to add the property to.
Note
You can also add properties to dispinterfaces, which, unless the project is attributed, are nested within the library node.
Right-click the name of interface.
From the shortcut menu, select Add > Add Property.
In the Add property wizard, provide the information to create the property.
Select OK to add the property.
Add Property wizard
The following section describes the UI that you'll use to add a property:
Property name
Sets the name of the property.
Property type
Sets the return type of the property.
Get function
Select to add a property getter. By default, the name of the
Get
function isGet
PropertyName. You can edit this name. If you delete the name, the functionGetNotSupported
is inserted into the interface dispatch map. TheGet
PropertyName function specifies the property as readable.For ATL interfaces Get function makes the property readable; that is, it creates the
Get
method for retrieving this property from the object. Select Get, Put, or both.Put function
Select to add a property setter. By default, the name of the
Set
function isSet
PropertyName. You can edit this name. If you delete the name, the functionSetNotSupported
is inserted into the interface dispatch map. TheSet
PropertyName function specifies that the property is writable.For ATL interfaces Put function makes the property writable; that is, it creates the
Put
method for setting, or "putting," this property of the object. Select Get, Put, or both.
See Also
Povratne informacije
https://aka.ms/ContentUserFeedback.
Kmalu na voljo: V letu 2024 bomo ukinili storitev Težave v storitvi GitHub kot mehanizem za povratne informacije za vsebino in jo zamenjali z novim sistemom za povratne informacije. Za več informacij si oglejte:Pošlji in prikaži povratne informacije za