IDebugEnumField::GetValueFromString

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. 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

This method returns the value associated with the name of an enumeration constant.

Syntax

HRESULT GetValueFromString(
   LPCOLESTR  pszValue,
   ULONGLONG* pvalue
);
int GetValueFromString(
   string    pszValue,
   out ulong pValue
);

Parameters

pszValue
[in] A string specifying the name for which to get the value. Note that for C++, this is a wide character string.

pValue
[out] Returns the associated numerical value.

Return Value

If successful, returns S_OK; otherwise, returns S_FALSE, if the name is not part of the enumeration, or an error code.

Remarks

This method is case-sensitive. If a case-insensitive search is needed (for example, in a language such as Visual Basic where names are not case sensitive), use GetValueFromStringCaseInsensitive.

See also