Python win32com.client function with propput

0

I'm using win32com.client to write a little plugin, but I have a problem with set a property. The definition for the property or function is this:

[id(0x00000021), propget, helpstring("property SystemChannel")]
long SystemChannel(
                long lVEN, 
                long lDEV, 
                long lSVID, 
                long lSID);

[id(0x00000021), propput, helpstring("property SystemChannel")]
void SystemChannel(
                long lVEN, 
                long lDEV, 
                long lSVID, 
                long lSID, 
                [in] long rhs);

I have not problems with get the value, the next code work greats:

app = Dispatch("CmAVConfig.AudioConfig")   
self.speakerNumber = app.SystemChannel(self.glVid, self.glDid, self.glSvid, self.glsid)

But I can't set the value of the same property, I have tried using the next instructions and I get the errors below:

app = Dispatch("CmAVConfig.AudioConfig")       
app.SystemChannel(self.glVid, self.glDid, self.glSvid, self.glsid, self.speakerNumber)
ERROR: SystemChannel() takes at most 5 arguments (6 given)

//this one is from a working example using javascript
app.SystemChannel(self.glVid, self.glDid, self.glSvid, self.glsid) = self.speakerNumber
ERROR: SyntaxError: ("can't assign to function call", ('ooo.py', 56, None, 'app.SystemChannel(self.glVid, self.glDid, self.glSvid, self.glsid) = self.speakerNumber\n'))
python
win32com
asked on Stack Overflow Aug 7, 2012 by user1583210

1 Answer

0

If you run makepy for the library (or use win32com.client.gencache.EnsureDispatch) it should create a SetSystemChannel method that takes an extra arg.

answered on Stack Overflow Aug 8, 2012 by Roger Upole

User contributions licensed under CC BY-SA 3.0