Documentation ¶
Index ¶
- Constants
- Variables
- func BstrToString(p *uint16) string
- func BytePtrToString(p *byte) string
- func CoInitialize(p uintptr) error
- func CoInitializeEx(p uintptr, coinit uint32) error
- func CoTaskMemFree(memptr uintptr)
- func CoUninitialize()
- func DeleteHString(hstring HString) (err error)
- func DispatchMessage(msg *Msg) int32
- func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (int32, error)
- func GetUserDefaultLCID() uint32
- func GetVariantDate(value float64) (time.Time, error)
- func IsEqualGUID(guid1 *GUID, guid2 *GUID) bool
- func LpOleStrToString(p *uint16) string
- func RoInitialize(thread_type uint32) (err error)
- func StringFromCLSID(clsid *GUID) (string, error)
- func StringFromIID(iid *GUID) (string, error)
- func SysAllocString(v string) *int16
- func SysAllocStringLen(v string) *int16
- func SysFreeString(v *int16) error
- func SysStringLen(v *int16) uint32
- func UTF16PtrToString(p *uint16) string
- func VariantClear(v *VARIANT) error
- func VariantInit(v *VARIANT) error
- type Connection
- type DISPPARAMS
- type Dispatch
- func (d *Dispatch) Call(method string, params ...interface{}) (result *VARIANT, err error)
- func (d *Dispatch) Get(name string, params ...interface{}) (result *VARIANT, err error)
- func (d *Dispatch) GetId(name string) (id int32, err error)
- func (d *Dispatch) GetIds(names ...string) (dispid []int32, err error)
- func (d *Dispatch) Invoke(id int32, dispatch int16, params []interface{}) (result *VARIANT, err error)
- func (d *Dispatch) MustCall(method string, params ...interface{}) (result *VARIANT)
- func (d *Dispatch) MustGet(name string, params ...interface{}) (result *VARIANT)
- func (d *Dispatch) MustSet(name string, params ...interface{}) (result *VARIANT)
- func (d *Dispatch) Release()
- func (d *Dispatch) Set(name string, params ...interface{}) (result *VARIANT, err error)
- type EXCEPINFO
- type GUID
- type HString
- type IConnectionPoint
- func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error)
- func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error)
- func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32
- func (v *IConnectionPoint) Unadvise(cookie uint32) error
- func (v *IConnectionPoint) VTable() *IConnectionPointVtbl
- type IConnectionPointContainer
- type IConnectionPointContainerVtbl
- type IConnectionPointVtbl
- type IDLDESC
- type IDispatch
- func (v *IDispatch) CallMethod(name string, params ...interface{}) (*VARIANT, error)
- func (v *IDispatch) GetIDsOfName(names []string) (dispid []int32, err error)
- func (v *IDispatch) GetProperty(name string, params ...interface{}) (*VARIANT, error)
- func (v *IDispatch) GetSingleIDOfName(name string) (displayID int32, err error)
- func (v *IDispatch) GetTypeInfo() (tinfo *ITypeInfo, err error)
- func (v *IDispatch) GetTypeInfoCount() (c uint32, err error)
- func (v *IDispatch) Invoke(dispid int32, dispatch int16, params ...interface{}) (result *VARIANT, err error)
- func (v *IDispatch) InvokeWithOptionalArgs(name string, dispatch int16, params []interface{}) (result *VARIANT, err error)
- func (v *IDispatch) PutProperty(name string, params ...interface{}) (*VARIANT, error)
- func (v *IDispatch) VTable() *IDispatchVtbl
- type IDispatchVtbl
- type IEnumVARIANT
- type IEnumVARIANTVtbl
- type IInspectable
- type IInspectableVtbl
- type INTERFACEDATA
- type IProvideClassInfo
- type IProvideClassInfoVtbl
- type ITypeInfo
- type ITypeInfoVtbl
- type IUnknown
- func (v *IUnknown) AddRef() int32
- func (v *IUnknown) IDispatch(interfaceID *GUID) (dispatch *IDispatch, err error)
- func (v *IUnknown) IEnumVARIANT(interfaceID *GUID) (enum *IEnumVARIANT, err error)
- func (v *IUnknown) MustQueryInterface(iid *GUID) (disp *IDispatch)
- func (v *IUnknown) PutQueryInterface(interfaceID *GUID, obj interface{}) error
- func (v *IUnknown) QueryInterface(iid *GUID) (*IDispatch, error)
- func (v *IUnknown) Release() int32
- func (v *IUnknown) VTable() *IUnknownVtbl
- type IUnknownVtbl
- type METHODDATA
- type Msg
- type OleError
- type PARAMDATA
- type Point
- type SAFEARRAY
- type SAFEARRAYBOUND
- type SafeArray
- type SafeArrayBound
- type SafeArrayConversion
- func (sac *SafeArrayConversion) GetDimensions() (dimensions *uint32, err error)
- func (sac *SafeArrayConversion) GetSize() (length *uint32, err error)
- func (sac *SafeArrayConversion) GetType() (varType uint16, err error)
- func (sac *SafeArrayConversion) Release()
- func (sac *SafeArrayConversion) ToByteArray() (bytes []byte)
- func (sac *SafeArrayConversion) ToStringArray() (strings []string)
- func (sac *SafeArrayConversion) ToValueArray() (values []interface{})
- func (sac *SafeArrayConversion) TotalElements(index uint32) (totalElements int64, err error)
- type TYPEATTR
- type TYPEDESC
- type UnknownLike
- type VARIANT
- type VT
Constants ¶
const ( CLSCTX_INPROC_SERVER = 1 CLSCTX_INPROC_HANDLER = 2 CLSCTX_LOCAL_SERVER = 4 CLSCTX_INPROC_SERVER16 = 8 CLSCTX_REMOTE_SERVER = 16 CLSCTX_ALL = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER CLSCTX_SERVER = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER )
const ( COINIT_APARTMENTTHREADED = 0x2 COINIT_MULTITHREADED = 0x0 COINIT_DISABLE_OLE1DDE = 0x4 COINIT_SPEED_OVER_MEMORY = 0x8 )
const ( DISPATCH_METHOD = 1 DISPATCH_PROPERTYGET = 2 DISPATCH_PROPERTYPUT = 4 DISPATCH_PROPERTYPUTREF = 8 )
const ( S_OK = 0x00000000 E_UNEXPECTED = 0x8000FFFF E_NOTIMPL = 0x80004001 E_OUTOFMEMORY = 0x8007000E E_INVALIDARG = 0x80070057 E_NOINTERFACE = 0x80004002 E_POINTER = 0x80004003 E_HANDLE = 0x80070006 E_ABORT = 0x80004004 E_FAIL = 0x80004005 E_ACCESSDENIED = 0x80070005 E_PENDING = 0x8000000A CO_E_CLASSSTRING = 0x800401F3 )
const ( CC_FASTCALL = iota CC_CDECL CC_MSCPASCAL CC_PASCAL = CC_MSCPASCAL CC_MACPASCAL CC_STDCALL CC_FPFASTCALL CC_SYSCALL CC_MPWCDECL CC_MPWPASCAL CC_MAX = CC_MPWPASCAL )
const ( DISPID_UNKNOWN = -1 DISPID_VALUE = 0 DISPID_PROPERTYPUT = -3 DISPID_NEWENUM = -4 DISPID_EVALUATE = -5 DISPID_CONSTRUCTOR = -6 DISPID_DESTRUCTOR = -7 DISPID_COLLECT = -8 )
const ( TKIND_ENUM = 1 TKIND_RECORD = 2 TKIND_MODULE = 3 TKIND_INTERFACE = 4 TKIND_DISPATCH = 5 TKIND_COCLASS = 6 TKIND_ALIAS = 7 TKIND_UNION = 8 TKIND_MAX = 9 )
const ( FADF_AUTO = 0x0001 FADF_STATIC = 0x0002 FADF_EMBEDDED = 0x0004 FADF_FIXEDSIZE = 0x0010 FADF_RECORD = 0x0020 FADF_HAVEIID = 0x0040 FADF_HAVEVARTYPE = 0x0080 FADF_BSTR = 0x0100 FADF_UNKNOWN = 0x0200 FADF_DISPATCH = 0x0400 FADF_VARIANT = 0x0800 FADF_RESERVED = 0xF008 )
Variables ¶
var ( // IID_NULL is null Interface ID, used when no other Interface ID is known. IID_NULL = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} // IID_IUnknown is for IUnknown interfaces. IID_IUnknown = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} // IID_IDispatch is for IDispatch interfaces. IID_IDispatch = &GUID{0x00020400, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} // IID_IEnumVariant is for IEnumVariant interfaces IID_IEnumVariant = &GUID{0x00020404, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} // IID_IConnectionPointContainer is for IConnectionPointContainer interfaces. IID_IConnectionPointContainer = &GUID{0xB196B284, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} // IID_IConnectionPoint is for IConnectionPoint interfaces. IID_IConnectionPoint = &GUID{0xB196B286, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} // IID_IInspectable is for IInspectable interfaces. IID_IInspectable = &GUID{0xaf86e2e0, 0xb12d, 0x4c6a, [8]byte{0x9c, 0x5a, 0xd7, 0xaa, 0x65, 0x10, 0x1e, 0x90}} // IID_IProvideClassInfo is for IProvideClassInfo interfaces. IID_IProvideClassInfo = &GUID{0xb196b283, 0xbab4, 0x101a, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} )
var ( // IID_ICOMTestString is for ICOMTestString interfaces. // // {E0133EB4-C36F-469A-9D3D-C66B84BE19ED} IID_ICOMTestString = &GUID{0xe0133eb4, 0xc36f, 0x469a, [8]byte{0x9d, 0x3d, 0xc6, 0x6b, 0x84, 0xbe, 0x19, 0xed}} // IID_ICOMTestInt8 is for ICOMTestInt8 interfaces. // // {BEB06610-EB84-4155-AF58-E2BFF53608B4} IID_ICOMTestInt8 = &GUID{0xbeb06610, 0xeb84, 0x4155, [8]byte{0xaf, 0x58, 0xe2, 0xbf, 0xf5, 0x36, 0x80, 0xb4}} // IID_ICOMTestInt16 is for ICOMTestInt16 interfaces. // // {DAA3F9FA-761E-4976-A860-8364CE55F6FC} IID_ICOMTestInt16 = &GUID{0xdaa3f9fa, 0x761e, 0x4976, [8]byte{0xa8, 0x60, 0x83, 0x64, 0xce, 0x55, 0xf6, 0xfc}} // IID_ICOMTestInt32 is for ICOMTestInt32 interfaces. // // {E3DEDEE7-38A2-4540-91D1-2EEF1D8891B0} IID_ICOMTestInt32 = &GUID{0xe3dedee7, 0x38a2, 0x4540, [8]byte{0x91, 0xd1, 0x2e, 0xef, 0x1d, 0x88, 0x91, 0xb0}} // IID_ICOMTestInt64 is for ICOMTestInt64 interfaces. // // {8D437CBC-B3ED-485C-BC32-C336432A1623} IID_ICOMTestInt64 = &GUID{0x8d437cbc, 0xb3ed, 0x485c, [8]byte{0xbc, 0x32, 0xc3, 0x36, 0x43, 0x2a, 0x16, 0x23}} // IID_ICOMTestFloat is for ICOMTestFloat interfaces. // // {BF1ED004-EA02-456A-AA55-2AC8AC6B054C} IID_ICOMTestFloat = &GUID{0xbf1ed004, 0xea02, 0x456a, [8]byte{0xaa, 0x55, 0x2a, 0xc8, 0xac, 0x6b, 0x5, 0x4c}} // IID_ICOMTestDouble is for ICOMTestDouble interfaces. // // {BF908A81-8687-4E93-999F-D86FAB284BA0} IID_ICOMTestDouble = &GUID{0xbf908a81, 0x8687, 0x4e93, [8]byte{0x99, 0x9f, 0xd8, 0x6f, 0xab, 0x28, 0x4b, 0xa0}} // IID_ICOMTestBoolean is for ICOMTestBoolean interfaces. // // {D530E7A6-4EE8-40D1-8931-3D63B8605001} IID_ICOMTestBoolean = &GUID{0xd530e7a6, 0x4ee8, 0x40d1, [8]byte{0x89, 0x31, 0x3d, 0x63, 0xb8, 0x60, 0x50, 0x10}} // IID_ICOMEchoTestObject is for ICOMEchoTestObject interfaces. // // {6485B1EF-D780-4834-A4FE-1EBB51746CA3} IID_ICOMEchoTestObject = &GUID{0x6485b1ef, 0xd780, 0x4834, [8]byte{0xa4, 0xfe, 0x1e, 0xbb, 0x51, 0x74, 0x6c, 0xa3}} // IID_ICOMTestTypes is for ICOMTestTypes interfaces. // // {CCA8D7AE-91C0-4277-A8B3-FF4EDF28D3C0} IID_ICOMTestTypes = &GUID{0xcca8d7ae, 0x91c0, 0x4277, [8]byte{0xa8, 0xb3, 0xff, 0x4e, 0xdf, 0x28, 0xd3, 0xc0}} // CLSID_COMEchoTestObject is for COMEchoTestObject class. // // {3C24506A-AE9E-4D50-9157-EF317281F1B0} CLSID_COMEchoTestObject = &GUID{0x3c24506a, 0xae9e, 0x4d50, [8]byte{0x91, 0x57, 0xef, 0x31, 0x72, 0x81, 0xf1, 0xb0}} // CLSID_COMTestScalarClass is for COMTestScalarClass class. // // {865B85C5-0334-4AC6-9EF6-AACEC8FC5E86} CLSID_COMTestScalarClass = &GUID{0x865b85c5, 0x0334, 0x4ac6, [8]byte{0x9e, 0xf6, 0xaa, 0xce, 0xc8, 0xfc, 0x5e, 0x86}} )
These are for testing and not part of any library.
Functions ¶
func BstrToString ¶
BstrToString converts COM binary string to Go string.
func BytePtrToString ¶
BytePtrToString converts byte pointer to a Go string.
func CoInitialize ¶
CoInitialize initializes COM library on current thread.
MSDN documentation suggests that this function should not be called. Call CoInitializeEx() instead. The reason has to do with threading and this function is only for single-threaded apartments.
That said, most users of the library have gotten away with just this function. If you are experiencing threading issues, then use CoInitializeEx().
func CoInitializeEx ¶
CoInitializeEx initializes COM library with concurrency model.
func GetMessage ¶
GetMessage in message queue from runtime.
This function appears to block. PeekMessage does not block.
func GetUserDefaultLCID ¶
func GetUserDefaultLCID() uint32
GetUserDefaultLCID retrieves current user default locale.
func LpOleStrToString ¶
LpOleStrToString converts COM Unicode to Go string.
func StringFromCLSID ¶
StringFromCLSID returns GUID formated string from GUID object.
func StringFromIID ¶
StringFromIID returns GUID formatted string from GUID object.
func SysAllocString ¶
SysAllocString allocates memory for string and copies string into memory.
func SysAllocStringLen ¶
SysAllocStringLen copies up to length of given string returning pointer.
func SysFreeString ¶
SysFreeString frees string system memory. This must be called with SysAllocString.
func SysStringLen ¶
SysStringLen is the length of the system allocated string.
func UTF16PtrToString ¶
UTF16PtrToString is alias for LpOleStrToString.
Kept for compatibility reasons.
func VariantClear ¶
VariantClear clears value in Variant settings to VT_EMPTY.
Types ¶
type Connection ¶
type Connection struct {
Object *IUnknown // Access COM
}
Connection contains IUnknown for fluent interface interaction.
Deprecated. Use oleutil package instead.
func Connect ¶
func Connect(names ...string) (connection *Connection)
Connect initializes COM and attempts to load IUnknown based on given names.
func (*Connection) Create ¶
func (c *Connection) Create(progId string) (err error)
Create IUnknown object based first on ProgId and then from String.
func (*Connection) Dispatch ¶
func (c *Connection) Dispatch() (object *Dispatch, err error)
Dispatch returns Dispatch object.
func (*Connection) Load ¶
func (c *Connection) Load(names ...string) (errors []error)
Load COM object from list of programIDs or strings.
type DISPPARAMS ¶
type DISPPARAMS struct {
// contains filtered or unexported fields
}
DISPPARAMS are the arguments that passed to methods or property.
type Dispatch ¶
type Dispatch struct {
Object *IDispatch // Dispatch object.
}
Dispatch stores IDispatch object.
func (*Dispatch) Invoke ¶
func (d *Dispatch) Invoke(id int32, dispatch int16, params []interface{}) (result *VARIANT, err error)
Invoke IDispatch on DisplayID of dispatch type with parameters.
There have been problems where if send cascading params..., it would error out because the parameters would be empty.
type EXCEPINFO ¶
type EXCEPINFO struct {
// contains filtered or unexported fields
}
EXCEPINFO defines exception info.
type GUID ¶
GUID is Windows API specific GUID type.
This exists to match Windows GUID type for direct passing for COM. Format is in xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx.
func CLSIDFromProgID ¶
CLSIDFromProgID retrieves Class Identifier with the given Program Identifier.
The Programmatic Identifier must be registered, because it will be looked up in the Windows Registry. The registry entry has the following keys: CLSID, Insertable, Protocol and Shell (https://msdn.microsoft.com/en-us/library/dd542719(v=vs.85).aspx).
programID identifies the class id with less precision and is not guaranteed to be unique. These are usually found in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Classes, usually with the format of "Program.Component.Version" with version being optional.
CLSIDFromProgID in Windows API.
func CLSIDFromString ¶
CLSIDFromString retrieves Class ID from string representation.
This is technically the string version of the GUID and will convert the string to object.
CLSIDFromString in Windows API.
func ClassIDFrom ¶
ClassIDFrom retrieves class ID whether given is program ID or application string.
Helper that provides check against both Class ID from Program ID and Class ID from string. It is faster, if you know which you are using, to use the individual functions, but this will check against available functions for you.
func IIDFromString ¶
IIDFromString returns GUID from program ID.
type HString ¶
type HString uintptr
HString is handle string for pointers.
func NewHString ¶
NewHString returns a new HString for Go string.
type IConnectionPoint ¶
type IConnectionPoint struct {
IUnknown
}
func (*IConnectionPoint) Advise ¶
func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error)
func (*IConnectionPoint) EnumConnections ¶
func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error)
func (*IConnectionPoint) GetConnectionInterface ¶
func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32
func (*IConnectionPoint) Unadvise ¶
func (v *IConnectionPoint) Unadvise(cookie uint32) error
func (*IConnectionPoint) VTable ¶
func (v *IConnectionPoint) VTable() *IConnectionPointVtbl
type IConnectionPointContainer ¶
type IConnectionPointContainer struct {
IUnknown
}
func (*IConnectionPointContainer) EnumConnectionPoints ¶
func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error
func (*IConnectionPointContainer) FindConnectionPoint ¶
func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error
func (*IConnectionPointContainer) VTable ¶
func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl
type IConnectionPointContainerVtbl ¶
type IConnectionPointContainerVtbl struct { IUnknownVtbl EnumConnectionPoints uintptr FindConnectionPoint uintptr }
type IConnectionPointVtbl ¶
type IDispatch ¶
type IDispatch struct {
IUnknown
}
func CreateStdDispatch ¶
CreateStdDispatch provides default IDispatch implementation for IUnknown.
This handles default IDispatch implementation for objects. It haves a few limitations with only supporting one language. It will also only return default exception codes.
func (*IDispatch) CallMethod ¶
CallMethod invokes named function with arguments on object.
func (*IDispatch) GetIDsOfName ¶
func (*IDispatch) GetProperty ¶
GetProperty retrieves the property with the name with the ability to pass arguments.
Most of the time you will not need to pass arguments as most objects do not allow for this feature. Or at least, should not allow for this feature. Some servers don't follow best practices and this is provided for those edge cases.
func (*IDispatch) GetSingleIDOfName ¶
GetSingleIDOfName is a helper that returns single display ID for IDispatch name.
This replaces the common pattern of attempting to get a single name from the list of available IDs. It gives the first ID, if it is available.
func (*IDispatch) GetTypeInfo ¶
func (*IDispatch) GetTypeInfoCount ¶
func (*IDispatch) InvokeWithOptionalArgs ¶
func (v *IDispatch) InvokeWithOptionalArgs(name string, dispatch int16, params []interface{}) (result *VARIANT, err error)
InvokeWithOptionalArgs accepts arguments as an array, works like Invoke.
Accepts name and will attempt to retrieve Display ID to pass to Invoke.
Passing params as an array is a workaround that could be fixed in later versions of Go that prevent passing empty params. During testing it was discovered that this is an acceptable way of getting around not being able to pass params normally.
func (*IDispatch) PutProperty ¶
PutProperty attempts to mutate a property in the object.
func (*IDispatch) VTable ¶
func (v *IDispatch) VTable() *IDispatchVtbl
type IDispatchVtbl ¶
type IDispatchVtbl struct { IUnknownVtbl GetTypeInfoCount uintptr GetTypeInfo uintptr GetIDsOfNames uintptr Invoke uintptr }
type IEnumVARIANT ¶
type IEnumVARIANT struct {
IUnknown
}
func (*IEnumVARIANT) Clone ¶
func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error)
func (*IEnumVARIANT) Reset ¶
func (enum *IEnumVARIANT) Reset() error
func (*IEnumVARIANT) Skip ¶
func (enum *IEnumVARIANT) Skip(celt uint) error
func (*IEnumVARIANT) VTable ¶
func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl
type IEnumVARIANTVtbl ¶
type IEnumVARIANTVtbl struct { IUnknownVtbl Next uintptr Skip uintptr Reset uintptr Clone uintptr }
type IInspectable ¶
type IInspectable struct {
IUnknown
}
func RoActivateInstance ¶
func RoActivateInstance(clsid string) (ins *IInspectable, err error)
RoActivateInstance
func RoGetActivationFactory ¶
func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error)
RoGetActivationFactory
func (*IInspectable) GetIids ¶
func (v *IInspectable) GetIids() ([]*GUID, error)
func (*IInspectable) GetRuntimeClassName ¶
func (v *IInspectable) GetRuntimeClassName() (string, error)
func (*IInspectable) GetTrustLevel ¶
func (v *IInspectable) GetTrustLevel() (uint32, error)
func (*IInspectable) VTable ¶
func (v *IInspectable) VTable() *IInspectableVtbl
type IInspectableVtbl ¶
type IInspectableVtbl struct { IUnknownVtbl GetIIds uintptr GetRuntimeClassName uintptr GetTrustLevel uintptr }
type INTERFACEDATA ¶
type INTERFACEDATA struct { MethodData *METHODDATA CMembers uint32 }
INTERFACEDATA defines interface info.
type IProvideClassInfo ¶
type IProvideClassInfo struct {
IUnknown
}
func (*IProvideClassInfo) GetClassInfo ¶
func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error)
func (*IProvideClassInfo) VTable ¶
func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl
type IProvideClassInfoVtbl ¶
type IProvideClassInfoVtbl struct { IUnknownVtbl GetClassInfo uintptr }
type ITypeInfo ¶
type ITypeInfo struct {
IUnknown
}
func (*ITypeInfo) GetTypeAttr ¶
func (*ITypeInfo) VTable ¶
func (v *ITypeInfo) VTable() *ITypeInfoVtbl
type ITypeInfoVtbl ¶
type ITypeInfoVtbl struct { IUnknownVtbl GetTypeAttr uintptr GetTypeComp uintptr GetFuncDesc uintptr GetVarDesc uintptr GetNames uintptr GetRefTypeOfImplType uintptr GetImplTypeFlags uintptr GetIDsOfNames uintptr Invoke uintptr GetDocumentation uintptr GetDllEntry uintptr GetRefTypeInfo uintptr AddressOfMember uintptr CreateInstance uintptr GetMops uintptr GetContainingTypeLib uintptr ReleaseTypeAttr uintptr ReleaseFuncDesc uintptr ReleaseVarDesc uintptr }
type IUnknown ¶
type IUnknown struct {
RawVTable *interface{}
}
func CreateDispTypeInfo ¶
func CreateDispTypeInfo(idata *INTERFACEDATA) (*IUnknown, error)
CreateDispTypeInfo provides default ITypeInfo implementation for IDispatch.
This will not handle the full implementation of the interface.
func CreateInstance ¶
CreateInstance of single uninitialized object with GUID.
func GetActiveObject ¶
GetActiveObject retrieves pointer to active object.
func (*IUnknown) IEnumVARIANT ¶
func (v *IUnknown) IEnumVARIANT(interfaceID *GUID) (enum *IEnumVARIANT, err error)
func (*IUnknown) MustQueryInterface ¶
func (*IUnknown) PutQueryInterface ¶
func (*IUnknown) VTable ¶
func (v *IUnknown) VTable() *IUnknownVtbl
type IUnknownVtbl ¶
type METHODDATA ¶
type METHODDATA struct { Name *uint16 Data *PARAMDATA Dispid int32 Meth uint32 CC int32 CArgs uint32 Flags uint16 VtReturn uint32 }
METHODDATA defines method info.
type OleError ¶
type OleError struct {
// contains filtered or unexported fields
}
OleError stores COM errors.
func NewErrorWithDescription ¶
NewErrorWithDescription creates new COM error with HResult and description.
func NewErrorWithSubError ¶
NewErrorWithSubError creates new COM error with parent error.
func (*OleError) Description ¶
Description retrieves error summary, if there is one.
type SAFEARRAY ¶
type SAFEARRAY SafeArray
SAFEARRAY is obsolete, exists for backwards compatibility. Use SafeArray
type SAFEARRAYBOUND ¶
type SAFEARRAYBOUND SafeArrayBound
SAFEARRAYBOUND is obsolete, exists for backwards compatibility. Use SafeArrayBound
type SafeArray ¶
type SafeArray struct { Dimensions uint16 FeaturesFlag uint16 ElementsSize uint32 LocksAmount uint32 Data uint32 Bounds [16]byte }
SafeArray is how COM handles arrays.
type SafeArrayBound ¶
SafeArrayBound defines the SafeArray boundaries.
type SafeArrayConversion ¶
type SafeArrayConversion struct {
Array *SafeArray
}
func (*SafeArrayConversion) GetDimensions ¶
func (sac *SafeArrayConversion) GetDimensions() (dimensions *uint32, err error)
func (*SafeArrayConversion) GetSize ¶
func (sac *SafeArrayConversion) GetSize() (length *uint32, err error)
func (*SafeArrayConversion) GetType ¶
func (sac *SafeArrayConversion) GetType() (varType uint16, err error)
func (*SafeArrayConversion) Release ¶
func (sac *SafeArrayConversion) Release()
Release Safe Array memory
func (*SafeArrayConversion) ToByteArray ¶
func (sac *SafeArrayConversion) ToByteArray() (bytes []byte)
func (*SafeArrayConversion) ToStringArray ¶
func (sac *SafeArrayConversion) ToStringArray() (strings []string)
func (*SafeArrayConversion) ToValueArray ¶
func (sac *SafeArrayConversion) ToValueArray() (values []interface{})
func (*SafeArrayConversion) TotalElements ¶
func (sac *SafeArrayConversion) TotalElements(index uint32) (totalElements int64, err error)
type TYPEATTR ¶
type TYPEATTR struct { Guid GUID Lcid uint32 MemidConstructor int32 MemidDestructor int32 LpstrSchema *uint16 CbSizeInstance uint32 Typekind int32 CFuncs uint16 CVars uint16 CImplTypes uint16 CbSizeVft uint16 CbAlignment uint16 WTypeFlags uint16 WMajorVerNum uint16 WMinorVerNum uint16 TdescAlias TYPEDESC IdldescType IDLDESC // contains filtered or unexported fields }
TYPEATTR defines type info.
type UnknownLike ¶
type VARIANT ¶
func NewVariant ¶
NewVariant returns new variant based on type and value.
func (*VARIANT) ToArray ¶
func (v *VARIANT) ToArray() *SafeArrayConversion
ToArray converts variant to SafeArray helper.
func (*VARIANT) ToIDispatch ¶
ToIDispatch converts variant to dispatch object.
func (*VARIANT) ToIUnknown ¶
ToIUnknown converts Variant to Unknown object.
func (*VARIANT) Value ¶
func (v *VARIANT) Value() interface{}
Value returns variant value based on its type.
Currently supported types: 2- and 4-byte integers, strings, bools. Note that 64-bit integers, datetimes, and other types are stored as strings and will be returned as strings.
Needs to be further converted, because this returns an interface{}.
type VT ¶
type VT uint16
const ( VT_EMPTY VT = 0x0 VT_NULL VT = 0x1 VT_I2 VT = 0x2 VT_I4 VT = 0x3 VT_R4 VT = 0x4 VT_R8 VT = 0x5 VT_CY VT = 0x6 VT_DATE VT = 0x7 VT_BSTR VT = 0x8 VT_DISPATCH VT = 0x9 VT_ERROR VT = 0xa VT_BOOL VT = 0xb VT_VARIANT VT = 0xc VT_UNKNOWN VT = 0xd VT_DECIMAL VT = 0xe VT_I1 VT = 0x10 VT_UI1 VT = 0x11 VT_UI2 VT = 0x12 VT_UI4 VT = 0x13 VT_I8 VT = 0x14 VT_UI8 VT = 0x15 VT_INT VT = 0x16 VT_UINT VT = 0x17 VT_VOID VT = 0x18 VT_HRESULT VT = 0x19 VT_PTR VT = 0x1a VT_SAFEARRAY VT = 0x1b VT_CARRAY VT = 0x1c VT_USERDEFINED VT = 0x1d VT_LPSTR VT = 0x1e VT_LPWSTR VT = 0x1f VT_RECORD VT = 0x24 VT_INT_PTR VT = 0x25 VT_UINT_PTR VT = 0x26 VT_FILETIME VT = 0x40 VT_BLOB VT = 0x41 VT_STREAM VT = 0x42 VT_STORAGE VT = 0x43 VT_STREAMED_OBJECT VT = 0x44 VT_STORED_OBJECT VT = 0x45 VT_BLOB_OBJECT VT = 0x46 VT_CF VT = 0x47 VT_CLSID VT = 0x48 VT_BSTR_BLOB VT = 0xfff VT_VECTOR VT = 0x1000 VT_ARRAY VT = 0x2000 VT_BYREF VT = 0x4000 VT_RESERVED VT = 0x8000 VT_ILLEGAL VT = 0xffff VT_ILLEGALMASKED VT = 0xfff VT_TYPEMASK VT = 0xfff )
Source Files ¶
- com_func.go
- connect.go
- constants.go
- error.go
- error_func.go
- guid.go
- iconnectionpoint.go
- iconnectionpoint_func.go
- iconnectionpointcontainer.go
- iconnectionpointcontainer_func.go
- idispatch.go
- idispatch_func.go
- ienumvariant.go
- ienumvariant_func.go
- iinspectable.go
- iinspectable_func.go
- iprovideclassinfo.go
- iprovideclassinfo_func.go
- itypeinfo.go
- itypeinfo_func.go
- iunknown.go
- iunknown_func.go
- ole.go
- safearray.go
- safearray_func.go
- safearrayconversion.go
- utility.go
- variant.go
- variant_amd64.go
- vt_string.go
- winrt_doc.go