static DWORD accessibilityState(COMPtr<IAccessible> element)
{
    VARIANT state;
    element->get_accState(self(), &state);

    ASSERT(V_VT(&state) == VT_I4);

    DWORD result = state.lVal;
    VariantClear(&state);

    return result;
}
static DWORD accessibilityState(COMPtr<IAccessible> element)
{
    _variant_t state;
    if (FAILED(element->get_accState(self(), &state.GetVARIANT())))
        return 0;

    ASSERT(V_VT(&state) == VT_I4);

    DWORD result = state.lVal;

    return result;
}