Example #1
0
// AllocateArrayDescriptorEx allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptorEx in Windows API.
func AllocateArrayDescriptorEx(variantType com.VariantType, dimensions uint32) (safearray *COMArray, err error) {
	err = com.MaybeError(C.SafeArrayAllocDescriptorEx(uint16(variantType), dimensions, unsafe.Pointer(&safearray)))
	return
}
Example #2
0
// AllocateArrayData allocates SafeArray.
//
// AKA: SafeArrayAllocData in Windows API.
func AllocateArrayData(safearray *COMArray) error {
	return com.MaybeError(C.SafeArrayAllocData(safearray))
}
Example #3
0
// AllocateArrayDescriptor allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptor in Windows API.
func AllocateArrayDescriptor(dimensions uint32) (safearray *COMArray, err error) {
	err = com.MaybeError(C.SafeArrayAllocDescriptor(dimensions, unsafe.Pointer(&safearray)))
	return
}
Example #4
0
// GetRecordInfo accesses IRecordInfo info for custom types.
//
// AKA: SafeArrayGetRecordInfo in Windows API.
//
// XXX: Must implement IRecordInfo interface for this to return.
func GetRecordInfo(safearray *COMArray) (recordInfo interface{}, err error) {
	err = com.MaybeError(C.SafeArrayGetRecordInfo(safearray, unsafe.Pointer(&recordInfo)))
	return
}
Example #5
0
// SetRecordInfo mutates IRecordInfo info for custom types.
//
// AKA: SafeArraySetRecordInfo in Windows API.
//
// XXX: Must implement IRecordInfo interface for this to return.
func SetRecordInfo(safearray *COMArray, recordInfo interface{}) error {
	return com.MaybeError(C.SafeArraySetRecordInfo(safearray, unsafe.Pointer(recordInfo)))
}
Example #6
0
// AccessData returns raw array.
//
// AKA: SafeArrayAccessData in Windows API.
func AccessData(safearray *COMArray) (element uintptr, err error) {
	err = com.MaybeError(C.SafeArrayAccessData(safearray, unsafe.Pointer(&element)))
	return
}
Example #7
0
// PutElement stores the data element at the specified location in the
// array.
//
// AKA: SafeArrayPutElement in Windows API.
func PutElement(safearray *COMArray, index int64, element interface{}) error {
	return com.MaybeError(C.SafeArrayPutElement(safearray, index, unsafe.Pointer(&element)))
}
Example #8
0
// SetInterfaceID sets the GUID of the interface for the specified safe
// array.
//
// AKA: SafeArraySetIID in Windows API.
func SetInterfaceID(safearray *COMArray, interfaceID *com.GUID) error {
	return com.MaybeError(C.SafeArraySetIID(safearray, interfaceID))
}
Example #9
0
// UnaccessData releases raw array.
//
// AKA: SafeArrayUnaccessData in Windows API.
func UnaccessData(safearray *COMArray) error {
	return com.MaybeError(C.SafeArrayUnaccessData(safearray))
}
Example #10
0
// Unlock unlocks SafeArray for reading.
//
// AKA: SafeArrayUnlock in Windows API.
func Unlock(safearray *COMArray) error {
	return com.MaybeError(C.SafeArrayUnlock(safearray))
}
Example #11
0
// GetPointerOfIndex gets a pointer to an array element.
//
// AKA: SafeArrayPtrOfIndex in Windows API.
func GetPointerOfIndex(safearray *COMArray, index int64) (ref uintptr, err error) {
	err = com.MaybeError(C.SafeArrayPtrOfIndex(safearray, index, unsafe.Pointer(&ref)))
	return
}
Example #12
0
// GetVariantType returns data type of SafeArray.
//
// AKA: SafeArrayGetVartype in Windows API.
func GetVariantType(safearray *COMArray) (varType uint16, err error) {
	err = com.MaybeError(C.SafeArrayGetVartype(safearray, unsafe.Pointer(&varType)))
	return
}
Example #13
0
// GetUpperBound returns upper bounds of SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetUBound in Windows API.
func GetUpperBound(safearray *COMArray, dimension uint32) (upperBound int64, err error) {
	err = com.MaybeError(C.SafeArrayGetUBound(safearray, dimension, unsafe.Pointer(&upperBound)))
	return
}
Example #14
0
// GetInterfaceID is the InterfaceID of the elements in the SafeArray.
//
// AKA: SafeArrayGetIID in Windows API.
func GetInterfaceID(safearray *COMArray) (guid *com.GUID, err error) {
	err = com.MaybeError(C.SafeArrayGetIID(safearray, unsafe.Pointer(&guid)))
	return
}
Example #15
0
// Duplicate returns copy of SafeArray.
//
// AKA: SafeArrayCopy in Windows API.
func Duplicate(original *COMArray) (safearray *COMArray, err error) {
	err = com.MaybeError(C.SafeArrayCopy(original, unsafe.Pointer(&safearray)))
	return
}
Example #16
0
// ResetDimensions changes the right-most (least significant) bound of the
// specified safe array.
//
// AKA: SafeArrayRedim in Windows API.
func ResetDimensions(safearray *COMArray, bounds *Bounds) error {
	return com.MaybeError(C.SafeArrayRedim(safearray, bounds))
}
Example #17
0
// DuplicateData duplicates SafeArray into another SafeArray object.
//
// AKA: SafeArrayCopyData in Windows API.
func DuplicateData(original, duplicate *COMArray) error {
	return com.MaybeError(C.SafeArrayCopyData(original, unsafe.Pointer(&duplicate)))
}
Example #18
0
// DestroyDescriptor destroys SafeArray object.
//
// AKA: SafeArrayDestroyDescriptor in Windows API.
func DestroyDescriptor(safearray *COMArray) error {
	return com.MaybeError(C.SafeArrayDestroyDescriptor(safearray))
}