Partager via


IDebugEnumField::GetValueFromString

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

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 IDebugEnumField::GetValueFromStringCaseInsensitive.

See Also

Reference

IDebugEnumField

IDebugEnumField::GetValueFromStringCaseInsensitive