Hi list,
I try to control a setup which consist of a  monochromator and a CCD camera.
I have no bid problems with CCD camera, it works pretty well via
Dispatch
... 
WinspecApp = win32com.Dispatchh("WinX32.WinX32App")
...
Here is Win32App CoClass from gen.py file

class Winx32App(CoClass):
    u"Roper Scientific's Winx32App Class"
        _reg_clsid_ = GUID('{675DA983-188A-11D1-9330-444553540000}')
            _idlflags_ = ['appobject']
                _typelib_path_ = typelib_path
                    _reg_typelib_ =
                    ('{1A762221-D8BA-11CF-AFC2-508201C10000}', 3, 12)
                    Winx32App._com_interfaces_ = [IWinx32App2,
                    IWinx32App]


                    # values for enumeration 'ExpSaveOpts'
                    EXPAS_BAD = 0
                    EXPAS_PROMPT = 1
                    EXPAS_AUTO = 2
                    EXPAS_NOSAVE = 3
                    ExpSaveOpts = c_int # enum

                    # values for enumeration 'PRC_PARAM'
                    PRC_OUTFILENAME = 1
                    PRC_AUTOSAVE = 2
                    PRC_FILEACCESS = 3
                    PRC_FILEINCCOUNT = 4
                    PRC_FILEINCENABLE = 5
                    PRC_NEWWINDOW = 6
                    PRC_OVERWRITECONFIRM = 7
                    PRC_RUNNING = 8
                    PRC_DISPLAYOUTPUT = 9
                    PRC_PARAM = c_int # enum
                    


Now if I try to access a monochromator coclass from another libray in
the same way I get com_error: (-2147221005. 
instrument =  win32com.client.Dispatch("JYMONOLib.IJYMonoReqd")
or
instrument =  win32com.client.Dispatch("JYMONOLib.Monochromator")
Here is gen file:

# -*- coding: mbcs -*-
typelib_path = u'C:\\Program Files\\Jobin Yvon\\Common\\JY
Components\\Monos\\JYMono\\JYMono.dll'
_lcid = 0 # change this if required
from ctypes import *
import comtypes.gen._638F5A15_35A6_4F7D_B8ED_B48A4CD4C619_0_1_0
from comtypes import GUID
from comtypes import CoClass


class Library(object):
    u'JYMono 1.0 Type Library'
        name = u'JYMONOLib'
            _reg_typelib_ = ('{D7E942DC-3716-4BC1-8DA2-08D273BDC501}',
            1, 0)

            class Monochromator(CoClass):
                u'Monochromator Class'
                    _reg_clsid_ =
                    GUID('{BFF968D4-7B20-4D16-BD3A-BDEFEB0863A4}')
                        _idlflags_ = []
                            _typelib_path_ = typelib_path
                                _reg_typelib_ =
                                ('{D7E942DC-3716-4BC1-8DA2-08D273BDC501}',
                                1, 0)
                                Monochromator._com_interfaces_ =
                                
[comtypes.gen._638F5A15_35A6_4F7D_B8ED_B48A4CD4C619_0_1_0.IJYMonoReqd]
                                Monochromator._outgoing_interfaces_ =
                                
[comtypes.gen._638F5A15_35A6_4F7D_B8ED_B48A4CD4C619_0_1_0._IJYDeviceReqdEvents]

                                __all__ = ['Monochromator']
                                from comtypes import _check_version;
                                _check_version('501')

I need somehow to access IJYMonoReqd interface 
Could anybody give me a hint about what I am doing wrong?

Thanks.
Petro


_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to