On Tue, Jan 18, 2011 at 12:24 AM, Tim Roberts <t...@probo.com> wrote:

> Somnath Naskar wrote:
> >
> > I am having an issue with 64 bit machine while using COM interface.I
> > am describing my problem in details....
> >
> > 1. I have a 64 bit machine and there I have installed python 64 bit
> > and 64 bit win32 module.
> > 2. In that machine I have installed Lotus Domino Admin Client of 32
> > bit version(because it's 64 bit version is not available.).
> > 3. Now I am Dispatching the Com objects of the Domino like ...
> >
> >                from win32com.client import Dispatch
> >               ses = Dispatch('Lotus.NotesSession')
> >
> > But I am getting the below error.
> >     IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
> > pythoncom.IID_IDispatch)
> >
> > com_error: (-2147221164, 'Class not registered', None, None)
> >
> > Is there any work around for this scenario.I want a solution for this.
> >
>
> You cannot call a 32-bit in-process COM object from a 64-bit process.
> It is simply not possible.
>
> You have several options.  You can try to create the object as an
> out-of-process server, which means that it will run as a separate
> executable, instead of as a DLL in your process.  The server has to
> support this explicitly, but Lotus is big enough that it might be there:
>
>    import pythoncom
>    ses = Dispatch('Lotus.NotesSession',
> clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
>
> If that doesn't work, you'll have to create your own 32-bit process to
> communicate with Lotus, with some kind of cross-process scheme to pass
> requests between you and the other process.
>
>
Hi Roberts,

Thank you for your response.Thank you very much.I am new in the industry.
I tried what you told as first option but it is giving following error...

>>> ses = Dispatch("Lotus.NoteSession",clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\site-packages\win32com\client\__init__.py", line 95,
in
Dispatch
    dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,c
lsctx)
  File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 104,
in
_GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 84,
in _
GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.II
D_IDispatch)
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)


The Second option you told is like to create my own 32 bit process to
communicate with Lotus, but I am afraid that I have no idea about how to
create q 32 bit process and also how to communicate to Lotus using that.
Please give me some code example and idea regarding that.


Thanks & Regards,
Somnath Naskar
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to