add_DisconnectButtonClicked method

int add_DisconnectButtonClicked(
  1. Pointer<NativeFunction<TypedEventHandler>> handler
)

Implementation

int add_DisconnectButtonClicked(
    Pointer<NativeFunction<TypedEventHandler>> handler) {
  final retValuePtr = calloc<IntPtr>();

  try {
    final hr = ptr.ref.vtable
        .elementAt(11)
        .cast<
            Pointer<
                NativeFunction<
                    HRESULT Function(
                        Pointer,
                        Pointer<NativeFunction<TypedEventHandler>> handler,
                        Pointer<IntPtr>)>>>()
        .value
        .asFunction<
            int Function(
                Pointer,
                Pointer<NativeFunction<TypedEventHandler>> handler,
                Pointer<IntPtr>)>()(ptr.ref.lpVtbl, handler, retValuePtr);

    if (FAILED(hr)) throw WindowsException(hr);

    final retValue = retValuePtr.value;
    return retValue;
  } finally {
    free(retValuePtr);
  }
}