RE: Unable to create com object - need help

Discussion in 'Python' started by Roman Yakovenko, Apr 14, 2004.

  1. Thank you very much. I definitly will try your module.
    Also I still have to questions:
    1. How does VB success to work with this dll?
    2. Why after using makepy utility I don't get interface registered in DiaSource class

    I understand that the first question is generic one, and has nothing to do with python.
    But any reference to this specifiec topic will be appreciated. Also I'd like to know the answer
    to the second question. It will help me a lot in my future work

    Roman.


    > -----Original Message-----
    > From: Thomas Heller [mailto:]
    > Sent: Wednesday, April 14, 2004 2:57 PM
    > To:
    > Subject: Re: Unable to create com object - need help
    >
    >
    > "Roman Yakovenko" <> writes:
    >
    > > Hi. I need some help.
    > > Here is my situation. It is a little bit difficult to

    > explain and/or understand.
    > > I'd like to use msdia71.dll. This dll gives you access to

    > program database files
    > > created during a build. I register this dll. This is pure com dll.
    > > This dll contains 3 top classes. I'd like to create one of

    > them - DiaSource.
    > > This class implements IDiaDataSource interface. This fact I

    > can see in dia2.idl.
    > >
    > > importlib("stdole2.tlb");
    > > [
    > > uuid(e60afbee-502d-46ae-858f-8272a09bd707),
    > > helpstring("DiaSource Class")
    > > ]
    > > coclass DiaSource
    > > {
    > > [default] interface IDiaDataSource;
    > > };
    > >
    > > after using makepy I get
    > >
    > > class DiaSource(CoClassBaseClass): # A CoClass
    > > # DiaSource Class
    > > CLSID = IID('{E60AFBEE-502D-46AE-858F-8272A09BD707}')
    > > coclass_sources = [
    > > ]
    > > coclass_interfaces = [
    > > ]
    > > If I understand right DiaSource doesn't implements

    > IDiaDataSource interface at all.
    > > May be this is a bug, may be I don't understand something.

    > Clarifying this point will be great.
    >
    > I think this has to do with the fact that with pywin32 you
    > cannot access
    > arbitrary com interfaces - only interfaces that either have
    > been wrapped
    > in pythoncom.dll or that derive from IDispatch. The DIA
    > interfaces all
    > derive from IUnknown, so it seems you cannot call them.
    >
    > There is ongoing work in pywin32 named 'universal' or something like
    > that, but I don't know how far it is.
    >
    > Another possibility is to use ctypes com layer, it has a tool somewhat
    > similar to makepy - it's called readtlb.py, and creates
    > python wrappers
    > for com interfaces. ctypes.com has some samples
    > demonstrating all this.
    >
    > HTH,
    >
    > Thomas
    >
    >
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
    Roman Yakovenko, Apr 14, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jon wayne
    Replies:
    9
    Views:
    693
    Jim Langston
    Sep 22, 2005
  2. Liming
    Replies:
    0
    Views:
    1,146
    Liming
    May 8, 2009
  3. rippul
    Replies:
    7
    Views:
    382
    Öö Tiib
    Nov 28, 2010
  4. Steve
    Replies:
    0
    Views:
    489
    Steve
    Oct 27, 2006
  5. Jake Barnes
    Replies:
    6
    Views:
    377
    9.co.uk
    Feb 8, 2006
Loading...

Share This Page