Request updates when DDE data changes.
(self, item, stop=False)
| 157 | DDE.Uninitialize(self._idInst) |
| 158 | |
| 159 | def advise(self, item, stop=False): |
| 160 | """Request updates when DDE data changes.""" |
| 161 | from ctypes import byref |
| 162 | |
| 163 | hszItem = DDE.CreateStringHandle(self._idInst, item, 1200) |
| 164 | hDdeData = DDE.ClientTransaction(LPBYTE(), 0, self._hConv, hszItem, CF_TEXT, XTYP_ADVSTOP if stop else XTYP_ADVSTART, TIMEOUT_ASYNC, LPDWORD()) |
| 165 | DDE.FreeStringHandle(self._idInst, hszItem) |
| 166 | if not hDdeData: |
| 167 | raise DDEError("Unable to %s advise" % ("stop" if stop else "start"), self._idInst) |
| 168 | DDE.FreeDataHandle(hDdeData) |
| 169 | |
| 170 | def execute(self, command, timeout=5000): |
| 171 | """Execute a DDE command.""" |