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 >> ctypes-users
ctypes-users
[ctypes-users] Can support for ctypes.com be dropped?
by Thomas Heller other posts by this author
Nov 4 2005 11:30AM messages near this date
[ctypes-users] type conversion question | Re: [ctypes-users] Can support for ctypes.com be dropped?
I'm currently undecided what to do with ctypes.com. I'd like to drop
support for ctypes.com (which means that ctypes.com will NOT work with
the next ctypes release), and concentrate on developing the comtypes
package.

The hope is that comtypes can soon completely replace ctypes.com,
although currently that's not yet the case.  Hopefully ctypes itself
will soon become stable enough that it really makes sense to release
comtypes separately from ctypes ;-).

comtypes is much easier to use than ctypes.com ever was, and more
powerful:

- you don't have to allocate [out] parameters yourself in client code,
  here is an example calling ITypeLib::GetDocumentation and
  ITypeInfo::GetDocumentation:

  from ctypes\com\tools\readtlb:

    def _get_documentation(self):
        name = BSTR()
        docstring = BSTR()
        helpcontext = c_ulong()
        helpfile = BSTR()
        self.tlb.GetDocumentation(-1, byref(name),
                                 byref(docstring), byref(helpcontext),
                                 byref(helpfile))
        self.name = mangle_name(name.value)
        self.docstring = docstring.value

  from comtypes\tools\tlbparser.py:

    def ParseRecord(self, tinfo):
        struct_name, doc, helpcntext, helpfile = tinfo.GetDocumentation(-1)

- automatic early binding to custom and dispatch interfaces.  The code
  generation is imo also much more complete, there should be no need to
  fix the generated modules manually before they work.  Some support
  to automatically include the generated wrappers with py2exe.

- describing a COM interface in comtypes looks much more like COM IDL,
  and contains more IDL attributes.  For example, here is the definition
  for the IConnectionPointContainer interface:

    class IConnectionPointContainer(IUnknown):
        _iid_ = GUID('{B196B284-BAB4-101A-B69C-00AA00341D07}')
        _idlflags_ = []

    IConnectionPointContainer._methods_ = [
        COMMETHOD([], HRESULT, 'EnumConnectionPoints',
                  ( ['out'], POINTER(POINTER(IEnumConnectionPoints)),
                    'ppEnum' )),
        COMMETHOD([], HRESULT, 'FindConnectionPoint',
                  ( ['in'], POINTER(_GUID), 'riid' ),
                  ( ['out'], POINTER(POINTER(IConnectionPoint)), 'ppCP' )),
    ]

- comtypes uses the standard logging module to allow easy debugging of
  the interesting aspects of client and server COM calls.  The plan is to
  insert a mechanism so that logging can be configured with a config file
  even when the COM server is packaged with py2exe.

- support for SAFEARRAY

- and more.

I still have production code that uses ctypes.com myself, and it will
take some time to rewrite and test all this for comtypes.  The
ctypes.com code that I currently use is not merged into the public CVS
at sourceforge, and I hope I can avoid to do that.

So here's the question: Can I drop support for ctypes.com in the next
ctypes release, and can I point ctypes.com users to older ctypes
versions where it is still supported?

Thomas




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
ctypes-users mailing list
ctypes-users@[...].net
https://lists.sourceforge.net/lists/listinfo/ctypes-users
Thread:
Thomas Heller
Thomas Heller

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