当前位置: 首页>>代码示例>>Python>>正文


Python VARIANT.vt方法代码示例

本文整理汇总了Python中comtypes.automation.VARIANT.vt方法的典型用法代码示例。如果您正苦于以下问题:Python VARIANT.vt方法的具体用法?Python VARIANT.vt怎么用?Python VARIANT.vt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comtypes.automation.VARIANT的用法示例。


在下文中一共展示了VARIANT.vt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: PutHardwareBreakPointer

# 需要导入模块: from comtypes.automation import VARIANT [as 别名]
# 或者: from comtypes.automation.VARIANT import vt [as 别名]
 def PutHardwareBreakPointer(self, index, addr, active=1, c_uiDID=0, privmask=0, slot=0,  
                             breaktype=u'Hardware', behavior=u'Execution', addrtype=u'IA32_PHY_PTR', dtsel=0, segsel=0, addrmask=0xffffffff):
     if self._itpBreakPointObj == None:
         return None
     
     if not self.DoesSupportBreakPointType('Hardware execution breakpoint'):
         return False
     
     #arr = [[VARIANT(0), VARIANT(1), ConvertToByteArray(addr, 8), VARIANT(1)]]
     
     arr = array.array('b')
     arr.fromlist([0L])
     bps = self._itpBreakPointObj.ReadBp(arr)
     print bps
     t = VARIANT()
     t.vt = comtypes.automation.VT_EMPTY
     t2 = VARIANT()
     t2.vt = comtypes.automation.VT_INT
     print self._itpBreakPointObj.QueryBpTypes(arr, 0x00000000L)
     self._itpBreakPointObj.WriteBp(bps)
     #arr = [0, 4, [segsel, ConvertToByteArray1(addr, 8), 0], 1]
     #try:
     #    arr = [[0, [5, 0], [segsel, addr, 0], 1]]
     #    self._itpBreakPointObj.WriteBp(arr)
     #except comtypes.COMError, hresult:
     #    print hresult
     #    return
     """
开发者ID:bluewish,项目名称:ProjectStudio,代码行数:30,代码来源:itpapi_i.py

示例2: intToVariant

# 需要导入模块: from comtypes.automation import VARIANT [as 别名]
# 或者: from comtypes.automation.VARIANT import vt [as 别名]
def intToVariant(i):
    '''
    helper method, constructs Windows "VARIANT" object representing an integer
    '''
    v = VARIANT()
    v.vt = VT_I4
    v.value = i
    assert( isinstance(i, int) )
    return v
开发者ID:askalski,项目名称:mats,代码行数:11,代码来源:accessible_msaa.py

示例3: test_BSTR

# 需要导入模块: from comtypes.automation import VARIANT [as 别名]
# 或者: from comtypes.automation.VARIANT import vt [as 别名]
    def test_BSTR(self):
        v = VARIANT()
        v.value = u"abc\x00123\x00"
        self.failUnlessEqual(v.value, "abc\x00123\x00")

        v.value = None
        # manually clear the variant
        v._.VT_I4 = 0

        # NULL pointer BSTR should be handled as empty string
        v.vt = VT_BSTR
        self.failUnless(v.value in ("", None))
开发者ID:nikmolnar,项目名称:comtypes,代码行数:14,代码来源:test_variant.py

示例4: test_decimal_as_decimal

# 需要导入模块: from comtypes.automation import VARIANT [as 别名]
# 或者: from comtypes.automation.VARIANT import vt [as 别名]
    def test_decimal_as_decimal(self):
        v = VARIANT()
        v.vt = VT_DECIMAL
        v.decVal.Lo64 = 1234
        v.decVal.scale = 3
        self.failUnlessEqual(v.value, decimal.Decimal('1.234'))

        v.decVal.sign = 0x80
        self.failUnlessEqual(v.value, decimal.Decimal('-1.234'))

        v.decVal.scale = 28
        self.failUnlessEqual(v.value, decimal.Decimal('-1.234e-25'))

        v.decVal.scale = 12
        v.decVal.Hi32 = 100
        self.failUnlessEqual(
            v.value, decimal.Decimal('-1844674407.370955162834'))
开发者ID:Python-Musings,项目名称:comtypes,代码行数:19,代码来源:test_variant.py

示例5: set_variant_matrix

# 需要导入模块: from comtypes.automation import VARIANT [as 别名]
# 或者: from comtypes.automation.VARIANT import vt [as 别名]
 def set_variant_matrix(self, value):
     if not self.is_nested_iterable(value):
         raise TypeError('Input data is not nested list/tuple.')
         
     if self.is_ragged(value):
         raise TypeError('Input data should not be a ragged array.')
         
     num_row = len(value)
     num_col = len(value[0])
     
     variant = VARIANT()
     _VariantClear(variant) # Clear the original data
     rgsa = (_safearray.SAFEARRAYBOUND * 2)()
     rgsa[0].cElements = num_row
     rgsa[0].lBound = 0
     rgsa[1].cElements = num_col
     rgsa[1].lBound = 0
                                             
     pa = _safearray.SafeArrayCreateEx(VT_VARIANT,
                                       2,
                                       rgsa,  # rgsaBound
                                       None)  # pvExtra
                                             
                                             
     if not pa:
         raise MemoryError()
 
     ptr = POINTER(VARIANT)()  # container for the values
     _safearray.SafeArrayAccessData(pa, byref(ptr))
     try:
         # I have no idea why 2D safearray is column-major.                
         index = 0
         for n in range(num_col):            
             for m in range(num_row):            
                 ptr[index] = value[m][n]
                 index += 1
     finally:
         _safearray.SafeArrayUnaccessData(pa)
     
     memmove(byref(variant._), byref(pa), sizeof(pa))  
     variant.vt = VT_ARRAY | VT_VARIANT
     return variant
开发者ID:xialulee,项目名称:WaveSyn,代码行数:44,代码来源:modelnode.py


注:本文中的comtypes.automation.VARIANT.vt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。