示例#1
0
// GetVariantType returns data type of SafeArray.
//
// AKA: SafeArrayGetVartype in Windows API.
func GetVariantType(safearray *COMArray) (varType com.VariantType, err error) {
	var vt uint16
	err = com.HResultToError(procSafeArrayGetVartype.Call(
		uintptr(unsafe.Pointer(safearray)),
		uintptr(unsafe.Pointer(&vt))))
	varType = com.VariantType(vt)
	return
}
示例#2
0
// VariantType returns the variant type, if there is one available.
//
// Flag com.HasVariantSafeArrayMask must be set.
func (sa *Array) VariantType() (varType com.VariantType, err error) {
	vt, err := GetVariantType(sa.Array)
	varType = com.VariantType(vt)
	return
}