problems using COM with Visual C
mhammond at skippinet.com.au
Thu Mar 16 23:03:23 CET 2000
This exact same question was asked about 2 weeks ago - check Deja
News, as you will find a helpful response from Roger Burnham.
"Jim Kerr" <jim_kerr at agilent.com> wrote in message
news:8ara42$pks$1 at nirvana.sr.hp.com...
> I'm trying to use Python's COM facilities to control a build in
> I've run into some problems that don't make sense to me at all (not
> since I don't know COM).
> Here's the script I have so far:
> # Open and manipulate a Visual C++ project
> from win32com.client import Dispatch
> projlist = vc.Projects
> ap = vc.ActiveProject()
> So far, so good; ap has the value 'MainApp', as it should. But if
> try to set the active project (from PythonWin)
> >>> vc.ActiveProject = 'Persist'
> ... it doesn't fly:
> Traceback (innermost last):
> File "<interactive input>", line 1, in ?
> File "C:\Program Files\Python\win32com\client\dynamic.py", line
> self._oleobj_.Invoke(self._olerepr_.propMap[attr].dispid, 0,
> pythoncom.DISPATCH_PROPERTYPUT, 0, value)
> com_error: (-2147352567, 'Exception occurred.', (61837, 'Microsoft
> C++', 'Unable to write read-only property.',
> 'C:\\PROGRA~1\\MICROS~3\\COMMON\\MSDEV98\\BIN\\MSDEV.HLP', 455053,
> The MSDEV documentation sure implies that ActiveProject is
> error seems kind of confusing.
> So anyway, I'm doing something wrong... I can accept that. But
> odd thing:
> from this point on, no matter what I type at the PythonWin prompt, a
> that says:
> 'The topic does not exist. Contact your application vendor for an
> Help file (129)'
> The only cure that I've found for this is to quit and restart
> Has anyone out there slayed these dragons before?
> FWIW, here are some OS and Python specifics:
> NT 4.0, Service Pack 5
> PythonWin build 125
> Thanks for the help!
More information about the Python-list