Skip to content

Commit

Permalink
[automation.py] Use WinDLL instead of windll
Browse files Browse the repository at this point in the history
  • Loading branch information
moi15moi committed Jan 25, 2025
1 parent 8977aa4 commit b63bb5a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions comtypes/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,12 @@ def ChangeType(self, typecode):
VARIANT = tagVARIANT
VARIANTARG = VARIANT

_oleaut32_nohresult = WinDLL("oleaut32")

_SysAllocStringLen = _oleaut32_nohresult.SysAllocStringLen
_SysAllocStringLen.argtypes = c_wchar_p, c_uint
_SysAllocStringLen.restype = c_void_p

_oleaut32 = OleDLL("oleaut32")

_VariantChangeType = _oleaut32.VariantChangeType
Expand All @@ -583,10 +589,6 @@ def ChangeType(self, typecode):
_VariantClear = _oleaut32.VariantClear
_VariantClear.argtypes = (POINTER(VARIANT),)

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

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

Expand Down

0 comments on commit b63bb5a

Please sign in to comment.