ctypes.ArgumentError: argument 1: : expected LP_POINT instance instead of pointer to POINT
See original GitHub issueReported on StackOverflow: https://stackoverflow.com/q/57304399/3648361
Expected Behavior
Actual Behavior
ctypes.windll.user32.GetCursorPos(ctypes.byref(cursor))
ctypes.ArgumentError: argument 1: : expected LP_POINT instance instead of pointer to POINT
Steps to Reproduce the Problem
- Install pywinauto
- Install
pyautogui==0.9.47 - Run the mentioned code
Short Example of Code to Demonstrate the Problem
slider = content_of_page.find_element_by_id("SystemSettings_Display_Brightness_Slider")
slider.click()
pyautogui.dragRel(args.value, 0, duration=1.0, button='left')
pyautogui.click()
Specifications
- Pywinauto version: unknown
- Python version and bitness: unknown
- Platform and OS: Windows
We should think on how to eliminate such errors even if another library behaves incorrectly. Maybe do explicit type conversion for every Win32 API function call.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to fix types.ArgumentError: argument 1: <class 'TypeError ...
GetCursorPos(ctypes.byref(cursor)) ctypes.ArgumentError: argument 1: : expected LP_POINT instance instead of pointer to POINT.
Read more >Issues with using C code in Python | Set 1 - GeeksforGeeks
ArgumentError : argument 3: : expected LP_c_int instance instead of int ... a ctypes.c_int is created and is passed in as the pointer...
Read more >ctypes — A foreign function library for Python — Python 3.11.1 ...
ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries....
Read more >glShaderSource and ctypes - Google Groups
ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: expected LP_LP_c_char instance instead of str definition: ... POINTER(GLchar)))
Read more >How to Use Python Pointers | Nick McCullum
Surprisingly, pointers don't really exist in Python. ... ArgumentError: argument 1: <class 'TypeError'>: expected LP_c_int instance instead ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@vasily-v-ryabov, might be worth exploring an old suggestion from https://bugs.python.org/issue22552
Well, it is fixed in master branch. Closing it before next release 0.6.8 (hope the last 0.6.x one).