Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: pythoncom on Windows Server 2008

12 views
Skip to first unread message

Mark Hammond

unread,
Nov 29, 2011, 7:34:23 PM11/29/11
to Nairn, Bruce, pytho...@python.org
On 30/11/2011 11:12 AM, Nairn, Bruce wrote:
> Hi,
>
> I’m trying to move some code to a Windows Server 2008 machine. It runs
> on Windows 7 and XP, but fails on Windows Server 2008. The python
> installation is seemingly identical (python 2.6.4, 32 bit). The
> following replicates the problem:
>
> import pythoncom
>
> IDispatch = pythoncom.CoCreateInstance (‘OPC.Automation’, None,
> pythoncom.CLSCTX_SERVER, pythoncom.IID_IDispatch)
>
> On Windows 7 x64 or Windows XP x32:
>
> this returns an PyIDispatch object
>
> On Windows Server 2008 x64 this gives:
>
> com_error: (-2147221005, ‘Invalid class string’, None, None)
>
> Any suggestions would be appreciated!

The OPC.Automation object isn't installed on the Server 2008 box. I'm
not sure what this object is so can't advise on how to install it. Note
also that you will need the same "bittedness" of the object as Python
itself has - ie, assuming a 32bit Python, you need the 32bit
implementation of the COM object, or if a 64bit Python, you need the
64bit COM object. Note that both the 32 and 64bit versions of both will
work fine on a 64bit version of Windows - you just need to make sure
they match.

Mark
0 new messages