pyvda icon indicating copy to clipboard operation
pyvda copied to clipboard

_ctypes.COMError

Open phpjunkie420 opened this issue 1 year ago • 11 comments

I used getattr in window.hwnd to see if the window has been closed. I did this to see if it would generate an exception and it did. The exception was _ctypes.COMError. I've tried to find this in pyvda and the required packages (comtypes, pywin32) but I've been unable to find it. I want to import it so I can contextlib.suppress the exception.

phpjunkie420 avatar Jan 30 '24 13:01 phpjunkie420

This works for me on Python 3.11:

>>> from _ctypes import COMError
>>> COMError
<class '_ctypes.COMError'>

Could you post the code that is generating the exception?

mrob95 avatar Jan 30 '24 18:01 mrob95

I believe I am getting a similar error. After I updated my machine to Windows 11 version 23H2, I got a COMError with the following message "(-2147467262, 'No such interface supported', (None, None, None, 0, None))" after importing pyvda. I have attached a screenshot of the call stack and the error. I am using pyvda version 0.3.2.

Thanks,

image

nanosil avatar Feb 09 '24 04:02 nanosil

having the same issue as @nanosil, i compiled my script with pyvda in it and have it to startup with my pc and running into this traceback error image

running the script non compiled runs into same issue, the compiled script was running fine for about a month before this issue and was running fine yesterday and currently runs fine on another pc, running windows 11 2h22 and just upgraded to 2h23 to see if it would help with the issue but does not work on either version

manfredcoco avatar Feb 14 '24 20:02 manfredcoco

I am seeing the same issue in winver 10.0.18363.836.

I understand that of course you may not have such an old version to test. I'm willing to help in providing data to support the version, if you keep it somewhere (so that it always works, regardless of version)

stdedos avatar Feb 15 '24 06:02 stdedos

Windows 11 might be fixed by 0.4.0, I will run the full test suite on monday

mrob95 avatar Feb 16 '24 18:02 mrob95

I am seeing the same issue in winver 10.0.18363.836.

I understand that of course you may not have such an old version to test. I'm willing to help in providing data to support the version, if you keep it somewhere (so that it always works, regardless of version)

I'd be happy to accept a PR to support it

mrob95 avatar Feb 16 '24 18:02 mrob95

I'd be happy to accept a PR to support it

Any ... guidelines on what's missing though? What to look for? How to look for it?

I am good with Python code - but I am a total beginner with regards to "Windows-things".

I do have a virtual-desktop-enhancer.ahk and a win-10-virtual-desktop-enhancer\libraries\virtual-desktop-accessor.dll that work tho

stdedos avatar Feb 16 '24 18:02 stdedos

I'd be happy to accept a PR to support it

Any ... guidelines on what's missing though? What to look for? How to look for it?

I am good with Python code - but I am a total beginner with regards to "Windows-things".

I do have a virtual-desktop-enhancer.ahk and a win-10-virtual-desktop-enhancer\libraries\virtual-desktop-accessor.dll that work tho

You should only need to modify code in this file: https://github.com/mrob95/pyvda/blob/master/pyvda/com_defns.py

You'll need to add a new BUILD_OVER_19041 variable (based on https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions this is the version after yours) to detect when we are running with your version. Then based on the code for the ahk script or the source code that the dll was built from you should be able to figure out what GUIDs and methods we need on the various objects.

The Makefile has a target for running the tests (requires pytest and pytest-cov) which you can use to validate that everything is working.

If you come across any issues feel free to open a separate issue - I'd like to avoid mixing the new win11 problems with the old win10 problems

mrob95 avatar Feb 16 '24 19:02 mrob95

Version 0.4.0 fixed it for me. Thank you!

nanosil avatar Feb 16 '24 19:02 nanosil

Same issue on OS Build 22631.3296

beratcmn avatar Mar 18 '24 21:03 beratcmn

Same issue on OS Build 22631.3296

I am using the same version without a problem. Could you make sure you are updated to the latest version (0.4.3)? If so, could you post the code you are running and the error message?

mrob95 avatar Mar 23 '24 13:03 mrob95