Skip to content

Commit d75523a

Browse files
Update example usage for IDiaSymbol::get_value
I believe that using `VariantInit` from oleauto.h is more future-proof rather than manually initializing the VARIANT's fields in case the internal implementation of VARIANT/VARIANTARG changes.
1 parent df702df commit d75523a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/debugger/debug-interface-access/idiasymbol-get-value.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The supplied VARIANT must be initialized before it is passed to this method. For
4444
void ProcessValue(IDiaSymbol *pSymbol)
4545
{
4646
VARIANT value;
47-
value.vt = VT_EMPTY; // Initialize variant for use.
47+
VariantInit(&value); // Initialize variant for use.
4848
if (pSymbol->get_value(&value) == S_OK)
4949
{
5050
// Do something with value.
@@ -65,3 +65,4 @@ void ProcessValue2(IDiaSymbol *pSymbol)
6565
6666
## See also
6767
- [IDiaSymbol](../../debugger/debug-interface-access/idiasymbol.md)
68+
- [Variant Manipulation Functions](/previous-versions/windows/desktop/automat/variant-manipulation-functions)

0 commit comments

Comments
 (0)