Skip to content

Commit

Permalink
[automation.py] Use WinDLL instead of OleDLL
Browse files Browse the repository at this point in the history
Only to have a more consistent code because we always use WinDLL
  • Loading branch information
moi15moi committed Jan 12, 2025
1 parent bc6b5e0 commit f696e5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions comtypes/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,23 +575,27 @@ def ChangeType(self, typecode):
VARIANT = tagVARIANT
VARIANTARG = VARIANT

_oleaut32 = OleDLL("oleaut32")
_oleaut32 = WinDLL("oleaut32")

_VariantChangeType = _oleaut32.VariantChangeType
_VariantChangeType.argtypes = (POINTER(VARIANT), POINTER(VARIANT), c_ushort, VARTYPE)
_VariantChangeType.restype = HRESULT

_VariantClear = _oleaut32.VariantClear
_VariantClear.argtypes = (POINTER(VARIANT),)
_VariantClear.restype = HRESULT

_SysAllocStringLen = windll.oleaut32.SysAllocStringLen
_SysAllocStringLen = _oleaut32.SysAllocStringLen
_SysAllocStringLen.argtypes = c_wchar_p, c_uint
_SysAllocStringLen.restype = c_void_p

_VariantCopy = _oleaut32.VariantCopy
_VariantCopy.argtypes = POINTER(VARIANT), POINTER(VARIANT)
_VariantCopy.restype = HRESULT

_VariantCopyInd = _oleaut32.VariantCopyInd
_VariantCopyInd.argtypes = POINTER(VARIANT), POINTER(VARIANT)
_VariantCopyInd.restype = HRESULT

# some commonly used VARIANT instances
VARIANT.null = VARIANT(None)
Expand Down

0 comments on commit f696e5f

Please sign in to comment.