From 9421c1195b2b0732e78975d9f6d9703d42b70db7 Mon Sep 17 00:00:00 2001 From: David Hall Date: Mon, 15 Jan 2018 09:42:07 -0700 Subject: [PATCH] Updated ToString method to handle vectors --- PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs b/PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs index 0c872b2f..368eeac3 100644 --- a/PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs +++ b/PInvoke/Ole/Ole32/PropIdl.PROPVARIANT.cs @@ -1055,7 +1055,9 @@ namespace Vanara.PInvoke public override string ToString() { string s = null; - if (PropVariantToStringAlloc(this, out SafeCoTaskMemString str).Succeeded) + if (IsVector && Value is IEnumerable ie) + s = string.Join(",", ie.Cast().Select(o => o.ToString()).ToArray()); + else if (PropVariantToStringAlloc(this, out var str).Succeeded) s = str; return $"{vt}={s ?? "null"}"; }