I was trying to use a GUI-only ActiveX Control in Python (using an OCX File) and I managed to get it working using PyQt5
as an intermediary.
See the below minimal example code using the ActiveX Control DATARAOCX.GetDataCtrl.1
.
I found this way more elegant than using comtypes
, wxpython
or similar, especially since comtypes
kept throwing a "Catastropic Error" whenever I try to access the ActiveX Control.
Hope this helps someone also stuck in this problem.
Hi, I also use GUI-only ActiveX and OCX file to drive DataRay Beam profile analyzer . Now, I can start the device successfully, but I don't know how to read the raw data from the device , In wxpython example supplied from DataRay, There's this piece of code:
self.px = wx.lib.activex.ActiveXCtrl(parent=self.frame,size=(300,200),axID='DATARAYOCX.ProfilesCtrl.1',pos=(0,270))
self.px.ctrl.ProfileID=4
self.py = wx.lib.activex.ActiveXCtrl(parent=self.frame,size=(300,200),axID='DATARAYOCX.ProfilesCtrl.1',pos=(320,270))
self.py.ctrl.ProfileID =5
I don't know how to write to realize the same function .