private static void MarshalReleaseComObject(object objCom)
{
try
{
int i = 1;
if (objCom != null && System.Runtime.InteropServices.Marshal.IsComObject(objCom))
{
do
{
i = System.Runtime.InteropServices.Marshal.ReleaseComObject(objCom);
} while (i > 0);
}
}
finally
{
objCom = null;
}
}
}