Bug fix on GetVarType

pull/10/head
David Hall 2018-01-27 14:36:14 -07:00
parent 7678ee102c
commit 5bd5219308
1 changed files with 2 additions and 2 deletions

View File

@ -574,14 +574,14 @@ namespace Vanara.PInvoke
var isEnumerable = type.IsArray || type != typeof(string) && typeof(IEnumerable).IsAssignableFrom(type);
var ret = isEnumerable ? VARTYPE.VT_VECTOR : 0;
if (isEnumerable && type.GetElementType() == null && type.IsGenericType)
if (isEnumerable && type.IsGenericType)
{
var i = type.GetInterface("IEnumerable`1");
if (i != null)
{
var args = i.GetGenericArguments();
if (args.Length == 1)
elemType = args[0];
elemtype = args[0];
}
}
if (elemtype.IsNullable()) ret |= VARTYPE.VT_BYREF;