473,569 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 DispatchWithEve nts or WithEvents -
e.g. "com_error: (-2147220992, 'CONNECT_E_NOCO NNECTION', 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
DispatchBaseCla ss 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 1787
>>>>> "Paul" == Paul Rudin <pa********@sci entia.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 DispatchWithEve nts or
WithEvents - e.g. "com_error: (-2147220992,
'CONNECT_E_NOCO NNECTION', 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 DispatchBaseCla ss 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_CoClassC hildren. Replacing the line:

dispItem.coclas s_clsid = coclass.clsid

with the lines:

if flags & pythoncom.IMPLT YPEFLAG_FDEFAUL T:
dispItem.coclas s_clsid = coclass.clsid
seems to solve the problem, although perhaps this breaks something
else?

Jul 18 '05 #2
Paul Rudin <pa********@sci entia.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********@sci entia.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
3830
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 modifications along the way to make the interface more Pythonic. For example, all of these functions return an error code (typically just errno passed...
53
3632
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. According to the "cooked-bench" benchmark suite it finishes in 55% of the time python takes;)
217
9028
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 Perl as a focus, I thought that some of the general points made might be of interest to the Python community. It would certainly be interesting to...
2
3087
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 View project althought rewritten in 1994, and has been used in a lot of bioinformatics projects http://www.eyedb.org/ Python does not have...
1
1620
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 libraries but is accompanied by a python package containing some pure python code and of course extension modules for the four libraries. Now during the...
0
3295
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 at, which requires the tet that contains a given point. Right now I'm brute-forcing it checking each tet for each point, which is very slow on large...
59
2494
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 objects, first call a class method to allocate the memory (typically alloc), and then call an initializer (typically starts with init). Some...
0
3900
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 with C ,so that it can extend the C APIs,and also get into closer relation with the system interface.Writing wrappers in python is achieved by using...
37
9025
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 across two projects that have the appeal of striving for simple, pythonic APIs: PyGUI and wax. The latter is a wrapper around wxPython. It is ...
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.