-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you have any ideas for a "Sample Python *server*" (and hooks in ctypes
)?
#35
Comments
Hi @junkmd and thank you for reaching out. I fully acknowledge that this project is missing a Python-based COM server sample. There is a COM class implemented in MyClientImpl though, but this is of course not a full server since it lacks registry entries and a class factory. I've never implemented a COM server myself in Python, so I'm currently unable to answer your questions related to that. However, let's keep this issue open, and I'll see if I'm able to take a stab at it within the next few months. No promises though... |
Status update: I've now added a small MyServerPy project that demonstrates how to implement COM servers in Python using |
Closing issue, since there's now a sample Python server project in this repo. I've only worked with EXE-based Python COM servers (CLSCTX_LOCAL_SERVER) myself, and not DLL-based (CLSCTX_INPROC_SERVER). I therefore lack experience with DllCanUnloadNow or DllGetClassObject from Python, and don't have much to contribute to that discussion. |
Thank you for your investigation, the sample, and the quick response. Even if you don’t have experience with As for |
Hi @forderud,
I, as a maintainer of
comtypes
, would like to ask for your input on something.Could you share your knowledge on implementing COM servers using
comtypes
and how the hooksctypes.DllCanUnloadNow
andctypes.DllGetClassObject
could work to this process?You’ve located both COM client and server samples implemented in C# and C++ to this repository, but only client samples in Python.
comtypes
documents a way to implement COM servers at https://pythonhosted.org/comtypes/server.html.However, that documentation hasn’t been updated in a long time, and the tests verifying this functionality are currently broken.
If you are aware of methods for implementing COM servers in Python that may not be well known in the community, or if you’ve encountered challenges in doing so in the past, I’d appreciate it if you could share those insights.
In the CPython community, we’re exploring improvements to the hooks defined in
ctypes
, moving away from their current reliance oncomtypes
.If you have any expertise or thoughts to share about these hooks, particularly from the perspective of someone with experience implementing COM servers in other languages, I’d be grateful if you could report them and participate in the discussion at python/cpython#127369.
The text was updated successfully, but these errors were encountered: