ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
RE: Pythonwin and makepy problems
by Stefan Schukat other posts by this author
May 21 2002 8:18AM messages near this date
[PMX:##] Re: ANSI colored output: How to determine how python was called? | Grep in Python
Hi,

your object probably does not support the runtime extraction of the CLSID.
Without this information the late bound wrapper doesn't know what 
kind of early bound wrapper to use. You can either give this information by
hand i.e.

# assuming import of the makepy wrapper is already done
from win32com.client import CLSIDToClass
import win32com
import pywintypes

MyLate = win32com.client.Dispatch(ProgID)
MyEarlyClass = CLSIDToClass.GetClass(str(pywintypes.IID(ProgID)))
MyEarly = MyEarlyClass(MyLate)

or if you rename [GUID].py to MyComObject.py just

import MyComObject
MyEarly = MyComObject.MyObject() # Name of the CoClass


Otherwise your dispatch implementation must support the GetTypeInfo function
and have a typelib either included or registered on the system.


	Stefan

-----Original Message-----
From: Joseph Toman [mailto:toman@[...].com]
Sent: Friday, May 17, 2002 4:52 PM
To: python-list@[...].org
Subject: Pythonwin and makepy problems






How exactly does Pythonwin know how to tab complete an object in the 
interpreter window? I've written a COM object which is registered and has a 
typelib (OLB) file created. Then I start pythonwin and run makepy on the 
object from there. When I look at the newly created "GUID".py file in gen_py
it looks like some dandy wrapper code, just what I would expect would be 
there. But when I create this object using
win32com.client.Dispatch(ProgID), tab completion doesn't work on the 
resultant object. This isn't such a big deal, except that the code I'm
using this object from depends on early binding to know whether an 
interface has an interator on it and things like that.  This used to work
with a previous (2.0) version of python. Running makepy on Excel works 
fine, and tab completion works on it. A toy COM object I wrote with the 
same compiler works fine as well. Ideas?

Compiler: Borland C++ 5.01
Python : 2.2.1 win32 binary from python.org
Python COM : win32all146 from starship

                                                J. Toman
-- 
http://mail.python.org/mailman/listinfo/python-list


-- 
http://mail.python.org/mailman/listinfo/python-list

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved