Esempio n. 1
0
func NewHString(s string) (hstring hstr.HString, err error) {
	u16 := windows.StringToUTF16Ptr(s)
	len := uint32(utf8.RuneCountInString(s))
	err = errors.MaybeError(procWindowsCreateString.Call(
		uintptr(unsafe.Pointer(u16)),
		uintptr(len),
		uintptr(unsafe.Pointer(&hstring))))
	return
}
Esempio n. 2
0
func RoActivateInstance(classID string) (obj *iinspectable.Inspectable, err error) {
	hClassID, err := NewHString(classID)
	if err != nil {
		return nil, err
	}
	defer DeleteHString(hClassID)

	err = errors.MaybeError(procRoActivateInstance.Call(
		uintptr(unsafe.Pointer(hClassID)),
		uintptr(unsafe.Pointer(&obj))))
	return
}
Esempio n. 3
0
func RoGetActivationFactory(classID string, interfaceID *types.GUID) (obj *iinspectable.Inspectable, err error) {
	hClassID, err := NewHString(classID)
	if err != nil {
		return nil, err
	}
	defer DeleteHString(hClassID)

	err = errors.MaybeError(procRoGetActivationFactory.Call(
		uintptr(unsafe.Pointer(hClassID)),
		uintptr(unsafe.Pointer(interfaceID)),
		uintptr(unsafe.Pointer(&obj))))
	return
}
Esempio n. 4
0
File: cgo.go Progetto: jmptrader/com
func AllocateArrayDescriptorEx(variantType types.VariantType, dimensions uint32) (array *types.COMArray, err error) {
	err = errors.MaybeError(C.SafeArrayAllocDescriptorEx(uint16(variantType), dimensions, unsafe.Pointer(&array)))
	return
}
Esempio n. 5
0
File: cgo.go Progetto: jmptrader/com
func AllocateArrayDescriptor(dimensions uint32) (array *types.COMArray, err error) {
	err = errors.MaybeError(C.SafeArrayAllocDescriptor(dimensions, unsafe.Pointer(&array)))
	return
}
Esempio n. 6
0
File: cgo.go Progetto: jmptrader/com
func AllocateArrayData(array *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayAllocData(array))
}
Esempio n. 7
0
File: cgo.go Progetto: jmptrader/com
func GetUpperBound(array *types.COMArray, dimension uint32) (upperBound int64, err error) {
	err = errors.MaybeError(C.SafeArrayGetUBound(array, dimension, unsafe.Pointer(&upperBound)))
	return
}
Esempio n. 8
0
File: cgo.go Progetto: jmptrader/com
func DestroyDescriptor(array *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayDestroyDescriptor(array))
}
Esempio n. 9
0
File: cgo.go Progetto: jmptrader/com
func PutElement(array *types.COMArray, index int64, element interface{}) error {
	return errors.MaybeError(C.SafeArrayPutElement(array, index, unsafe.Pointer(&element)))
}
Esempio n. 10
0
File: cgo.go Progetto: jmptrader/com
func ResetDimensions(array *types.COMArray, bounds *types.Bounds) error {
	return errors.MaybeError(C.SafeArrayRedim(array, bounds))
}
Esempio n. 11
0
File: cgo.go Progetto: jmptrader/com
func SetInterfaceID(array *types.COMArray, interfaceID *types.GUID) error {
	return errors.MaybeError(C.SafeArraySetIID(array, interfaceID))
}
Esempio n. 12
0
File: cgo.go Progetto: jmptrader/com
func GetPointerOfIndex(array *types.COMArray, index int64) (ref uintptr, err error) {
	err = errors.MaybeError(C.SafeArrayPtrOfIndex(array, index, unsafe.Pointer(&ref)))
	return
}
Esempio n. 13
0
File: cgo.go Progetto: jmptrader/com
func Unlock(array *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayUnlock(array))
}
Esempio n. 14
0
File: cgo.go Progetto: jmptrader/com
func GetVariantType(array *types.COMArray) (varType uint16, err error) {
	err = errors.MaybeError(C.SafeArrayGetVartype(array, unsafe.Pointer(&varType)))
	return
}
Esempio n. 15
0
File: cgo.go Progetto: jmptrader/com
func Duplicate(original *types.COMArray) (array *types.COMArray, err error) {
	err = errors.MaybeError(C.SafeArrayCopy(original, unsafe.Pointer(&array)))
	return
}
Esempio n. 16
0
File: cgo.go Progetto: jmptrader/com
func DuplicateData(original, duplicate *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayCopyData(original, unsafe.Pointer(&duplicate)))
}
Esempio n. 17
0
File: cgo.go Progetto: jmptrader/com
func GetRecordInfo(array *types.COMArray) (recordInfo interface{}, err error) {
	err = errors.MaybeError(C.SafeArrayGetRecordInfo(array, unsafe.Pointer(&recordInfo)))
	return
}
Esempio n. 18
0
func RoInitialize(threadType uint32) error {
	return errors.MaybeError(procRoInitialize.Call(uintptr(threadType)))
}
Esempio n. 19
0
File: cgo.go Progetto: jmptrader/com
func SetRecordInfo(array *types.COMArray, recordInfo interface{}) error {
	return errors.MaybeError(C.SafeArraySetRecordInfo(array, unsafe.Pointer(recordInfo)))
}
Esempio n. 20
0
File: cgo.go Progetto: jmptrader/com
func AccessData(array *types.COMArray) (element uintptr, err error) {
	err = errors.MaybeError(C.SafeArrayAccessData(array, unsafe.Pointer(&element)))
	return
}
Esempio n. 21
0
File: cgo.go Progetto: jmptrader/com
func UnaccessData(array *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayUnaccessData(array))
}
Esempio n. 22
0
func DeleteHString(hstring hstr.HString) error {
	return errors.MaybeError(procWindowsDeleteString.Call(uintptr(hstring)))
}
Esempio n. 23
0
File: cgo.go Progetto: jmptrader/com
func GetInterfaceID(array *types.COMArray) (guid *types.GUID, err error) {
	err = errors.MaybeError(C.SafeArrayGetIID(array, unsafe.Pointer(&guid)))
	return
}