Use an OCX file

Joined
Mar 9, 2010
Messages
1
Reaction score
0
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top