473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

python com wrappers


I'm having a problem with the python wrappers generated from a type
library.

The symptom is that I get failures to find connections points inside
the wrappers when called from DispatchWithEvents or WithEvents -
e.g. "com_error: (-2147220992, 'CONNECT_E_NOCONNECTION', None, None)"

It seems that the coclass_clsid property of some classes is
incorrect. It seems that when a coclass in the type library has
multiple "[source] dispinterface" it can happen that this coclass can
end up as the one referenced by each of the corresponding
DispatchBaseClass subclasses via the coclass_clsid property, whereas
probably what should happen is that only ones that are default should
be so treated.

But maybe I'm misdiagnosing the problem; has anyone else seen this
and/or know what the problem is?

Jul 18 '05 #1
3 1779
>>>>> "Paul" == Paul Rudin <pa********@scientia.com> writes:
I'm having a problem with the python wrappers generated from a
type library. The symptom is that I get failures to find connections points
inside the wrappers when called from DispatchWithEvents or
WithEvents - e.g. "com_error: (-2147220992,
'CONNECT_E_NOCONNECTION', None, None)" It seems that the coclass_clsid property of some classes is
incorrect. It seems that when a coclass in the type library has
multiple "[source] dispinterface" it can happen that this
coclass can end up as the one referenced by each of the
corresponding DispatchBaseClass subclasses via the coclass_clsid
property, whereas probably what should happen is that only ones
that are default should be so treated. But maybe I'm misdiagnosing the problem; has anyone else seen
this and/or know what the problem is?


To test this I had a quick look at the code that generates the
wrappers. In win32com/client/genpy.py The class Generator has a method
_Build_CoClassChildren. Replacing the line:

dispItem.coclass_clsid = coclass.clsid

with the lines:

if flags & pythoncom.IMPLTYPEFLAG_FDEFAULT:
dispItem.coclass_clsid = coclass.clsid
seems to solve the problem, although perhaps this breaks something
else?

Jul 18 '05 #2
Paul Rudin <pa********@scientia.com> writes:
[...]
seems to solve the problem, although perhaps this breaks something
else?


Try posting what you just wrote to the python-win32 list.
John
Jul 18 '05 #3
jj*@pobox.com (John J. Lee) wrote in message news:<87************@pobox.com>...
Paul Rudin <pa********@scientia.com> writes:
[...]
seems to solve the problem, although perhaps this breaks something
else?


Try posting what you just wrote to the python-win32 list.
John


John,

Could you provide a pointer to that list? I know of the Mailing Lists
at Source Forge, but they are just a bug reporting one and checkins
one. Thanks.
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Roy Smith | last post by:
I've got a C library with about 50 calls in it that I want to wrap in Python. I know I could use some tool like SWIG, but that will give me a too-literal translation; I want to make some...
53
by: Stelios Xanthakis | last post by:
Hi. pyvm is a program which can run python 2.4 bytecode (the .pyc files). A demo pre-release is available at: http://students.ceid.upatras.gr/~sxanth/pyvm/ Facts about pyvm: - It's FAST....
217
by: gyromagnetic | last post by:
The following url points to an article written by Damian Conway entitled "Ten Essential Development Practices": http://www.perl.com/pub/a/2005/07/14/bestpractices.html Althought the article has...
2
by: GinTon | last post by:
EyeDB is a free ODBMS based on the ODMG 3 specification with programming interfaces for C++ and Java. It is very powerfull, mature, safe and stable. In fact, it was developed in 1992 for the Genome...
1
by: Mark Asbach | last post by:
Hi pythonians, I'm one of the maintainers of an open source image processing toolkit (OpenCV) and responsible for parts of the autotools setup. The package mainly consists of four shared...
0
by: Neilen Marais | last post by:
Hi. I'm doing a FEM (Finite Elements) code in python. It uses a tetrahedral mesh to represent the geometry. For post-processing one specifies a list of 3D coordinates to calculate field values...
59
by: Kevin Walzer | last post by:
From the introduction to PyObjC, the Python-Objective-C bridge on Mac OS X: "As described in Objective-C for PyObjC users the creation of Objective-C objects is a two-stage process. To initialize...
0
kaarthikeyapreyan
by: kaarthikeyapreyan | last post by:
Python an easy to program language becomes very powerful when they interact close with your system,for this purpose he gets friendly with this guy named C. Python establishes tightly bound wrappers...
37
by: Michael Palmer | last post by:
As anyone knows, the state of Python GUI programming is a little fractured at this time, with many toolkits, wrappers and meta-wrappers dead and alive, with or without documentation. I've come...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.