github.com/secoba/wails/v2@v2.6.4/internal/frontend/desktop/windows/winc/w32/idispatch.go (about)

     1  //go:build windows
     2  
     3  /*
     4   * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
     5   * Copyright (C) 2010-2012 The W32 Authors. All Rights Reserved.
     6   */
     7  package w32
     8  
     9  import (
    10  	"unsafe"
    11  )
    12  
    13  type pIDispatchVtbl struct {
    14  	pQueryInterface   uintptr
    15  	pAddRef           uintptr
    16  	pRelease          uintptr
    17  	pGetTypeInfoCount uintptr
    18  	pGetTypeInfo      uintptr
    19  	pGetIDsOfNames    uintptr
    20  	pInvoke           uintptr
    21  }
    22  
    23  type IDispatch struct {
    24  	lpVtbl *pIDispatchVtbl
    25  }
    26  
    27  func (this *IDispatch) QueryInterface(id *GUID) *IDispatch {
    28  	return ComQueryInterface((*IUnknown)(unsafe.Pointer(this)), id)
    29  }
    30  
    31  func (this *IDispatch) AddRef() int32 {
    32  	return ComAddRef((*IUnknown)(unsafe.Pointer(this)))
    33  }
    34  
    35  func (this *IDispatch) Release() int32 {
    36  	return ComRelease((*IUnknown)(unsafe.Pointer(this)))
    37  }
    38  
    39  func (this *IDispatch) GetIDsOfName(names []string) []int32 {
    40  	return ComGetIDsOfName(this, names)
    41  }
    42  
    43  func (this *IDispatch) Invoke(dispid int32, dispatch int16, params ...interface{}) *VARIANT {
    44  	return ComInvoke(this, dispid, dispatch, params...)
    45  }