Use an OCX file

Discussion in 'Python' started by yohannbzh, Mar 9, 2010.

  1. yohannbzh

    yohannbzh

    Joined:
    Mar 9, 2010
    Messages:
    1
    Hello,

    I'm desperately seeking a solution to a problem I have.
    I want to use in a Python script a function of an OCX file that I already use in a C++ project. I have saved this file in the registry. Here's how I'm currently trying to use the function :
    Code:
    from win32com.client.gencache import EnsureModule
    gencache.EnsureModule(CLSID, 0, 1, 0)
    m = Dispatch(PROGID)
    # So far, it works.
    # If I display 'm', It writes the good description of my OCX file 
    # in the string representation of 'm'.
    # If I type m.<TAB>, functions that I want to use appears well
    m.myFunction()
    # At this moment, i have a catastrophic failure '-2147418113' (0x8000FFFF)
    
    Have someone a sense of worry that there may be? I tried lots of different ways, with comtypes,... but still the same problem.
    I used the makepy.py script from win32com.client to generate a Python wrapper for my OCX file. I see my functions when I read the generated file.
    Maybe I must init something but I don't know what.
    Thank you

    Yohann

    PS : Sorry for my English, I'm French.
    yohannbzh, Mar 9, 2010
    #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. Donald
    Replies:
    2
    Views:
    689
    Jack Klein
    Dec 19, 2003
  2. Guy Cohen

    Use my OCX

    Guy Cohen, Oct 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    372
    Guy Cohen
    Oct 4, 2006
  3. karspy@gmail.com
    Replies:
    2
    Views:
    488
    red floyd
    Mar 8, 2006
  4. Sush
    Replies:
    2
    Views:
    1,049
    mlimber
    Jun 16, 2006
  5. Tom
    Replies:
    0
    Views:
    377
Loading...

Share This Page