IVsWritableSettingsStore.GetStringOrDefault Method

Definition

Returns a string type property value or a given default string.

public:
 int GetStringOrDefault(System::String ^ collectionPath, System::String ^ propertyName, System::String ^ defaultValue, [Runtime::InteropServices::Out] System::String ^ % value);
int GetStringOrDefault(std::wstring const & collectionPath, std::wstring const & propertyName, std::wstring const & defaultValue, [Runtime::InteropServices::Out] std::wstring const & & value);
public int GetStringOrDefault (string collectionPath, string propertyName, string defaultValue, out string value);
abstract member GetStringOrDefault : string * string * string * string -> int
Public Function GetStringOrDefault (collectionPath As String, propertyName As String, defaultValue As String, ByRef value As String) As Integer

Parameters

collectionPath
String

[in] The path of the collection.

propertyName
String

[in] The property name.

defaultValue
String

[in] The default value to return if the property is not set.

value
String

[out] The value. This should be passed as an uninitialized BSTR and the method will allocate enough space to hold the value of the property. The caller should call SysFreeString to release the BSTR when it is no longer needed.

Returns

Returns S_OK if the property was returned, S_FALSE if the property does not exist, or E_INVALIDARG if the property type is not an integer.

Implements

Remarks

This method is safe to access from any thread.

Applies to