package ole

import "github.com/zzl/go-com/ole"

Index

Functions

func As

func As[TTo OleClientConstraint, TFrom OleClientConstraint](from TFrom) TTo

func CheckVarType

func CheckVarType(value interface{}) win32.VARENUM

func HiMetricToPixel

func HiMetricToPixel(hiX, hiY int32) (int32, int32)

func Initialize

func Initialize()

func NewIDispatch

func NewIDispatch(impl win32.IDispatchInterface) *win32.IDispatch

func ProcessOptArgs

func ProcessOptArgs(argNames []string, optArgs []interface{}) []interface{}

func SetVariantParam

func SetVariantParam(v *Variant, value interface{}, unwrapActions *Actions)

func Uninitialize

func Uninitialize()

Types

type Action

type Action func()

type Actions

type Actions struct {
	// contains filtered or unexported fields
}

func (*Actions) Add

func (this *Actions) Add(action Action)

func (*Actions) Execute

func (this *Actions) Execute()

type Array

type Array[T any] struct {
	Psa *win32.SAFEARRAY
}

func NewArray

func NewArray[T any](count int32, scoped bool) Array[T]

func NewArray2D

func NewArray2D[T any](count1 int32, count2 int32, scoped bool) Array[T]

func NewArray2DWithBase

func NewArray2DWithBase[T any](base1, count1, base2, count2 int32, scoped bool) Array[T]

func NewArrayByAttach

func NewArrayByAttach[T any](Psa *win32.SAFEARRAY) Array[T]

func NewArrayWithBase

func NewArrayWithBase[T any](base int32, count int32, scoped bool) Array[T]

func NewArrayWithBounds

func NewArrayWithBounds[T any](bounds []win32.SAFEARRAYBOUND, scoped bool) Array[T]

func NewArrayWithVt

func NewArrayWithVt[T any](varType win32.VARENUM, bounds []win32.SAFEARRAYBOUND, scoped bool) Array[T]

func (Array[T]) Copy

func (me Array[T]) Copy() Array[T]

func (Array[T]) Destroy

func (me Array[T]) Destroy()

func (Array[T]) Detach

func (me Array[T]) Detach() *win32.SAFEARRAY

func (Array[T]) GetAt

func (me Array[T]) GetAt(index ...int32) (ret T)

func (Array[T]) GetCount

func (me Array[T]) GetCount(dim int) int

func (Array[T]) GetDimCount

func (me Array[T]) GetDimCount() int

func (Array[T]) GetLowerBound

func (me Array[T]) GetLowerBound(dim int) int

func (Array[T]) GetShape

func (me Array[T]) GetShape() []int32

func (Array[T]) GetUpperBound

func (me Array[T]) GetUpperBound(dim int) int

func (Array[T]) GetVarType

func (me Array[T]) GetVarType() win32.VARENUM

func (Array[T]) SafeArrayPtr

func (me Array[T]) SafeArrayPtr() *win32.SAFEARRAY

func (Array[T]) SetAt

func (me Array[T]) SetAt(index int, value T)

func (Array[T]) SetAt2

func (me Array[T]) SetAt2(rowIndex int, colIndex int, value T)

func (Array[T]) SetAtEx

func (me Array[T]) SetAtEx(index int, value T, copy bool)

func (Array[T]) SetAtMd

func (me Array[T]) SetAtMd(index []int32, value T)

func (Array[T]) ToVar

func (me Array[T]) ToVar() Variant

func (Array[T]) ToVarEx

func (me Array[T]) ToVarEx(copy bool, scoped bool) Variant

type Currency

type Currency win32.CY

type Date

type Date float64

func NewOleDateFromGoTime

func NewOleDateFromGoTime(t time.Time) Date

func (Date) ToGoTime

func (me Date) ToGoTime() time.Time

type Decimal

type Decimal win32.DECIMAL

type DispatchClass

type DispatchClass struct {
	OleClient
}

func NewDispatchClass

func NewDispatchClass(pDisp *win32.IDispatch, scoped bool) *DispatchClass

type DynClient

type DynClient struct {
	OleClient
	// contains filtered or unexported fields
}

func NewDynClient

func NewDynClient(source interface{}, addRef bool, scoped bool) *DynClient

func (*DynClient) Call

func (this *DynClient) Call(name string, args ...interface{}) (*Variant, error)

func (*DynClient) Get

func (this *DynClient) Get(name string) (*Variant, error)

func (*DynClient) Set

func (this *DynClient) Set(name string, value interface{}) error

func (*DynClient) SetRef

func (this *DynClient) SetRef(name string, value interface{}) error

type IConnectionPointComObj

type IConnectionPointComObj struct {
	com.IUnknownComObj
}

func (*IConnectionPointComObj) Advise

func (this *IConnectionPointComObj) Advise(pUnkSink *win32.IUnknown, pdwCookie *uint32) uintptr

func (*IConnectionPointComObj) BuildVtbl

func (this *IConnectionPointComObj) BuildVtbl(lock bool) *win32.IConnectionPointVtbl

func (*IConnectionPointComObj) EnumConnections

func (this *IConnectionPointComObj) EnumConnections(ppEnum **win32.IEnumConnections) uintptr

func (*IConnectionPointComObj) GetConnectionInterface

func (this *IConnectionPointComObj) GetConnectionInterface(pIID *syscall.GUID) uintptr

func (*IConnectionPointComObj) GetConnectionPointContainer

func (this *IConnectionPointComObj) GetConnectionPointContainer(ppCPC **win32.IConnectionPointContainer) uintptr

func (*IConnectionPointComObj) GetVtbl

func (this *IConnectionPointComObj) GetVtbl() *win32.IUnknownVtbl

func (*IConnectionPointComObj) IID

func (this *IConnectionPointComObj) IID() *syscall.GUID

func (*IConnectionPointComObj) Unadvise

func (this *IConnectionPointComObj) Unadvise(dwCookie uint32) uintptr

type IConnectionPointContainerComObj

type IConnectionPointContainerComObj struct {
	com.IUnknownComObj
}

func (*IConnectionPointContainerComObj) BuildVtbl

func (*IConnectionPointContainerComObj) EnumConnectionPoints

func (this *IConnectionPointContainerComObj) EnumConnectionPoints(ppEnum **win32.IEnumConnectionPoints) uintptr

func (*IConnectionPointContainerComObj) FindConnectionPoint

func (this *IConnectionPointContainerComObj) FindConnectionPoint(riid *syscall.GUID, ppCP **win32.IConnectionPoint) uintptr

func (*IConnectionPointContainerComObj) GetVtbl

func (*IConnectionPointContainerComObj) IID

type IConnectionPointContainerImplSupport

type IConnectionPointContainerImplSupport struct {
	ConnectPoints []*IConnectionPointComObj
}

func (*IConnectionPointContainerImplSupport) EnumConnectionPoints

func (this *IConnectionPointContainerImplSupport) EnumConnectionPoints(ppEnum **win32.IEnumConnectionPoints) win32.HRESULT

func (*IConnectionPointContainerImplSupport) FindConnectionPoint

func (this *IConnectionPointContainerImplSupport) FindConnectionPoint(riid *syscall.GUID, ppCP **win32.IConnectionPoint) win32.HRESULT

func (*IConnectionPointContainerImplSupport) OnComObjFree

func (this *IConnectionPointContainerImplSupport) OnComObjFree()

type IConnectionPointImpl

type IConnectionPointImpl struct {
	com.IUnknownImpl
	Container *win32.IConnectionPointContainer
	SourceIID *syscall.GUID
	Sinks     []*OleClient
}

func (*IConnectionPointImpl) Advise

func (this *IConnectionPointImpl) Advise(pUnkSink *win32.IUnknown, pdwCookie *uint32) win32.HRESULT

func (*IConnectionPointImpl) EnumConnections

func (this *IConnectionPointImpl) EnumConnections(ppEnum **win32.IEnumConnections) win32.HRESULT

func (*IConnectionPointImpl) GetConnectionInterface

func (this *IConnectionPointImpl) GetConnectionInterface(pIID *syscall.GUID) win32.HRESULT

func (*IConnectionPointImpl) GetConnectionPointContainer

func (this *IConnectionPointImpl) GetConnectionPointContainer(ppCPC **win32.IConnectionPointContainer) win32.HRESULT

func (*IConnectionPointImpl) OnComObjFree

func (this *IConnectionPointImpl) OnComObjFree()

func (*IConnectionPointImpl) Unadvise

func (this *IConnectionPointImpl) Unadvise(dwCookie uint32) win32.HRESULT

type IDispatchComObj

type IDispatchComObj struct {
	com.IUnknownComObj
}

func NewIDispatchComObject

func NewIDispatchComObject(impl win32.IDispatchInterface) *IDispatchComObj

func (*IDispatchComObj) BuildVtbl

func (this *IDispatchComObj) BuildVtbl(lock bool) *win32.IDispatchVtbl

func (*IDispatchComObj) GetIDsOfNames

func (this *IDispatchComObj) GetIDsOfNames(riid *syscall.GUID,
	rgszNames *win32.PWSTR, cNames uint32, lcid uint32, rgDispId *int32) uintptr

func (*IDispatchComObj) GetTypeInfo

func (this *IDispatchComObj) GetTypeInfo(iTInfo uint32, lcid uint32,
	ppTInfo **win32.ITypeInfo) uintptr

func (*IDispatchComObj) GetTypeInfoCount

func (this *IDispatchComObj) GetTypeInfoCount(pctinfo *uint32) uintptr

func (*IDispatchComObj) GetVtbl

func (this *IDispatchComObj) GetVtbl() *win32.IUnknownVtbl

func (*IDispatchComObj) IDispatch

func (this *IDispatchComObj) IDispatch() *win32.IDispatch

func (*IDispatchComObj) Invoke

func (this *IDispatchComObj) Invoke(dispIdMember int32, riid *syscall.GUID,
	lcid uint32, wFlags win32.DISPATCH_FLAGS, pDispParams *win32.DISPPARAMS,
	pVarResult *win32.VARIANT, pExcepInfo *win32.EXCEPINFO, puArgErr *uint32) uintptr

type IDispatchImpl

type IDispatchImpl struct {
	com.IUnknownImpl
}

func (*IDispatchImpl) GetIDsOfNames

func (this *IDispatchImpl) GetIDsOfNames(riid *syscall.GUID, rgszNames *win32.PWSTR, cNames uint32, lcid uint32, rgDispId *int32) win32.HRESULT

func (*IDispatchImpl) GetTypeInfo

func (this *IDispatchImpl) GetTypeInfo(iTInfo uint32, lcid uint32, ppTInfo **win32.ITypeInfo) win32.HRESULT

func (*IDispatchImpl) GetTypeInfoCount

func (this *IDispatchImpl) GetTypeInfoCount(pctinfo *uint32) win32.HRESULT

func (*IDispatchImpl) Invoke

func (this *IDispatchImpl) Invoke(dispIdMember int32, riid *syscall.GUID, lcid uint32, wFlags uint16, pDispParams *win32.DISPPARAMS, pVarResult *win32.VARIANT, pExcepInfo *win32.EXCEPINFO, puArgErr *uint32) win32.HRESULT

func (*IDispatchImpl) QueryInterface

func (this *IDispatchImpl) QueryInterface(riid *syscall.GUID, ppvObject unsafe.Pointer) win32.HRESULT

type IDispatchProvider

type IDispatchProvider interface {
	GetIDispatch(addRef bool) *win32.IDispatch
}

type IEnumConnectionsComObj

type IEnumConnectionsComObj struct {
	com.IUnknownComObj
}

func (*IEnumConnectionsComObj) BuildVtbl

func (this *IEnumConnectionsComObj) BuildVtbl(lock bool) *win32.IEnumConnectionsVtbl

func (*IEnumConnectionsComObj) Clone

func (this *IEnumConnectionsComObj) Clone(ppEnum **win32.IEnumConnections) uintptr

func (*IEnumConnectionsComObj) GetVtbl

func (this *IEnumConnectionsComObj) GetVtbl() *win32.IUnknownVtbl

func (*IEnumConnectionsComObj) IID

func (this *IEnumConnectionsComObj) IID() *syscall.GUID

func (*IEnumConnectionsComObj) Next

func (this *IEnumConnectionsComObj) Next(cConnections uint32, rgcd *win32.CONNECTDATA, pcFetched *uint32) uintptr

func (*IEnumConnectionsComObj) Reset

func (this *IEnumConnectionsComObj) Reset() uintptr

func (*IEnumConnectionsComObj) Skip

func (this *IEnumConnectionsComObj) Skip(cConnections uint32) uintptr

type IEnumConnectionsImpl

type IEnumConnectionsImpl struct {
	com.IUnknownImpl
	// contains filtered or unexported fields
}

func (*IEnumConnectionsImpl) Clone

func (*IEnumConnectionsImpl) Next

func (this *IEnumConnectionsImpl) Next(cConnections uint32, rgcd *win32.CONNECTDATA, pcFetched *uint32) win32.HRESULT

func (*IEnumConnectionsImpl) OnComObjFree

func (this *IEnumConnectionsImpl) OnComObjFree()

func (*IEnumConnectionsImpl) Reset

func (this *IEnumConnectionsImpl) Reset() win32.HRESULT

func (*IEnumConnectionsImpl) Skip

func (this *IEnumConnectionsImpl) Skip(cConnections uint32) win32.HRESULT

type IProvideClassInfo2ComObj

type IProvideClassInfo2ComObj struct {
	IProvideClassInfoComObj
}

func (*IProvideClassInfo2ComObj) BuildVtbl

func (*IProvideClassInfo2ComObj) GetGUID

func (this *IProvideClassInfo2ComObj) GetGUID(dwGuidKind uint32, pGUID *syscall.GUID) uintptr

func (*IProvideClassInfo2ComObj) GetVtbl

func (this *IProvideClassInfo2ComObj) GetVtbl() *win32.IUnknownVtbl

func (*IProvideClassInfo2ComObj) IID

func (this *IProvideClassInfo2ComObj) IID() *syscall.GUID

type IProvideClassInfo2Impl

type IProvideClassInfo2Impl struct {
	IProvideClassInfoImplSupport
	DefaultSourceIID *syscall.GUID
}

func (*IProvideClassInfo2Impl) GetGUID

func (this *IProvideClassInfo2Impl) GetGUID(dwGuidKind uint32, pGUID *syscall.GUID) win32.HRESULT

type IProvideClassInfoComObj

type IProvideClassInfoComObj struct {
	com.IUnknownComObj
}

func (*IProvideClassInfoComObj) BuildVtbl

func (*IProvideClassInfoComObj) GetClassInfo

func (this *IProvideClassInfoComObj) GetClassInfo(ppTI **win32.ITypeInfo) uintptr

func (*IProvideClassInfoComObj) GetVtbl

func (this *IProvideClassInfoComObj) GetVtbl() *win32.IUnknownVtbl

func (*IProvideClassInfoComObj) IID

func (this *IProvideClassInfoComObj) IID() *syscall.GUID

type IProvideClassInfoImplSupport

type IProvideClassInfoImplSupport struct {
	//unnecessary pUnknownImpl *com.IUnknownImpl
	TypeInfo *win32.ITypeInfo
}

func (*IProvideClassInfoImplSupport) GetClassInfo

func (this *IProvideClassInfoImplSupport) GetClassInfo(ppTI **win32.ITypeInfo) win32.HRESULT

func (*IProvideClassInfoImplSupport) OnComObjFree

func (this *IProvideClassInfoImplSupport) OnComObjFree()

type NamedArg

type NamedArg struct {
	Name  string
	Value interface{}
}

type NamedArgs

type NamedArgs map[string]interface{}

type OleClient

type OleClient struct {
	*win32.IDispatch
}

func CreateClient

func CreateClient(clsid *win32.CLSID) (*OleClient, error)

func (*OleClient) Call

func (this *OleClient) Call(dispId win32.DISPID,
	reqArgs []interface{}, optArgs ...interface{}) (*Variant, error)

func (*OleClient) Dispose

func (this *OleClient) Dispose()

func (*OleClient) GetOleClient

func (this *OleClient) GetOleClient() *OleClient

func (*OleClient) PropGet

func (this *OleClient) PropGet(dispId win32.DISPID,
	reqArgs []interface{}, optArgs ...interface{}) (*Variant, error)

func (*OleClient) PropPut

func (this *OleClient) PropPut(dispId win32.DISPID,
	reqArgs []interface{}, optArgs ...interface{}) error

func (*OleClient) PropPutRef

func (this *OleClient) PropPutRef(dispId win32.DISPID,
	reqArgs []interface{}, optArgs ...interface{}) error

type OleClientConstraint

type OleClientConstraint interface {
	GetOleClient() *OleClient
}

type OleClientProvider

type OleClientProvider interface {
	GetOleClient() *OleClient
}

type SafeArrayInterface

type SafeArrayInterface interface {
	SafeArrayPtr() *win32.SAFEARRAY
}

type Variant

type Variant win32.VARIANT

func NewVar

func NewVar(value interface{}) *Variant

func NewVarScoped

func NewVarScoped(value interface{}) *Variant

func NewVariant

func NewVariant(value interface{}) *Variant

func NewVariantBool

func NewVariantBool(b bool) *Variant

func NewVariantDispatch

func NewVariantDispatch(pDisp *win32.IDispatch) *Variant

ref added

func NewVariantScode

func NewVariantScode(hr win32.HRESULT) *Variant

func NewVariantString

func NewVariantString(s string) *Variant

func ProcessInvokeArgs

func ProcessInvokeArgs(pDispParams *win32.DISPPARAMS, formalArgc int) ([]*Variant, []int)

func Var

func Var(value interface{}) Variant

func VarScoped

func VarScoped(value interface{}) Variant

func VariantFromValue

func VariantFromValue(value interface{}) *Variant

func (*Variant) AsVARIANT

func (this *Variant) AsVARIANT() *win32.VARIANT

func (*Variant) ChangeType

func (this *Variant) ChangeType(vt win32.VARENUM) (*Variant, error)

func (*Variant) Clear

func (this *Variant) Clear()

func (*Variant) Copy

func (this *Variant) Copy() *Variant

func (*Variant) IDispatch

func (this *Variant) IDispatch() *win32.IDispatch

func (*Variant) Int

func (this *Variant) Int() int

func (*Variant) Int32

func (this *Variant) Int32() int32

func (*Variant) String

func (this *Variant) String() string

func (*Variant) ToArray

func (this *Variant) ToArray() (*win32.SAFEARRAY, error)

no copy

func (*Variant) ToBool

func (this *Variant) ToBool() (bool, error)

func (*Variant) ToByte

func (this *Variant) ToByte() (byte, error)

func (*Variant) ToByteRef

func (this *Variant) ToByteRef() *byte

func (*Variant) ToCurrency

func (this *Variant) ToCurrency() (Currency, error)

func (*Variant) ToDecimal

func (this *Variant) ToDecimal() (Decimal, error)

func (*Variant) ToFloat32

func (this *Variant) ToFloat32() (float32, error)

func (*Variant) ToFloat32Ref

func (this *Variant) ToFloat32Ref() *float32

func (*Variant) ToFloat64

func (this *Variant) ToFloat64() (float64, error)

func (*Variant) ToFloat64Ref

func (this *Variant) ToFloat64Ref() *float64

func (*Variant) ToHresult

func (this *Variant) ToHresult() (win32.HRESULT, error)

func (*Variant) ToIDispatch

func (this *Variant) ToIDispatch() (*win32.IDispatch, error)

func (*Variant) ToIUnknown

func (this *Variant) ToIUnknown() (*win32.IUnknown, error)

func (*Variant) ToInt

func (this *Variant) ToInt() (int, error)

func (*Variant) ToInt16

func (this *Variant) ToInt16() (int16, error)

func (*Variant) ToInt16Ref

func (this *Variant) ToInt16Ref() *int16

func (*Variant) ToInt32

func (this *Variant) ToInt32() (int32, error)

func (*Variant) ToInt32Ref

func (this *Variant) ToInt32Ref() *int32

func (*Variant) ToInt64

func (this *Variant) ToInt64() (int64, error)

func (*Variant) ToInt64Ref

func (this *Variant) ToInt64Ref() *int64

func (*Variant) ToInt8

func (this *Variant) ToInt8() (int8, error)

func (*Variant) ToInt8Ref

func (this *Variant) ToInt8Ref() *int8

func (*Variant) ToPointer

func (this *Variant) ToPointer() unsafe.Pointer

func (*Variant) ToString

func (this *Variant) ToString() (string, error)

func (*Variant) ToTime

func (this *Variant) ToTime() (time.Time, error)

func (*Variant) ToUInt

func (this *Variant) ToUInt() (uint, error)

func (*Variant) ToUint16

func (this *Variant) ToUint16() (uint16, error)

func (*Variant) ToUint16Ref

func (this *Variant) ToUint16Ref() *uint16

func (*Variant) ToUint32

func (this *Variant) ToUint32() (uint32, error)

func (*Variant) ToUint32Ref

func (this *Variant) ToUint32Ref() *uint32

func (*Variant) ToUint64

func (this *Variant) ToUint64() (uint64, error)

func (*Variant) ToUint64Ref

func (this *Variant) ToUint64Ref() *uint64

func (*Variant) ToUint8

func (this *Variant) ToUint8() (uint8, error)

func (*Variant) ToUint8Ref

func (this *Variant) ToUint8Ref() *uint8

func (*Variant) Uint32

func (this *Variant) Uint32() uint32

func (*Variant) Uint64

func (this *Variant) Uint64() uint64

func (*Variant) Value

func (v *Variant) Value() interface{}

func (*Variant) ValueOfType

func (this *Variant) ValueOfType(typ reflect.Type) (value interface{}, err error)

type VariantBool

type VariantBool struct {
	Vt win32.VARENUM //4@0

	Value win32.VARIANT_BOOL //2@8
	// contains filtered or unexported fields
}

type VariantDispatch

type VariantDispatch struct {
	Vt win32.VARENUM //4@0

	Value *win32.IDispatch //8@8
	// contains filtered or unexported fields
}

type VariantScode

type VariantScode struct {
	Vt win32.VARENUM //4@0

	Value win32.HRESULT //4@8
	// contains filtered or unexported fields
}

type VariantString

type VariantString struct {
	Vt win32.VARENUM //4@0

	Value win32.BSTR //8@8
	// contains filtered or unexported fields
}

Source Files

array.go context.go dynclient.go event.go impl.go oleclient.go types.go utils.go variant.go

Directories

PathSynopsis
ole/oleimpl
Version
v1.5.0 (latest)
Published
Jan 29, 2023
Platform
linux/amd64
Imports
12 packages
Last checked
3 months ago

Tools for package owners.