Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Use an OCX file

Thread Tools

Use an OCX file

yohannbzh yohannbzh is offline
Junior Member
Join Date: Mar 2010
Posts: 1

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 :
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
# 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 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


PS : Sorry for my English, I'm French.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use an OCX in my app ? Tom ASP .Net 0 09-14-2008 01:46 PM
Use my OCX Guy Cohen ASP .Net 0 10-04-2006 02:20 PM
"hhctrl.ocx file in in-use" Sush C++ 2 06-16-2006 12:16 PM
Re-Register an OCX file.... The Prophecy Computer Support 1 04-18-2004 05:00 AM
can i use installshield to deploy an ocx? Donald C++ 2 12-19-2003 04:57 AM