MCPcopy Create free account
hub / github.com/ActiveState/code / advise

Method advise

recipes/Python/577654_DDE_Client/recipe-577654.py:159–168  ·  view source on GitHub ↗

Request updates when DDE data changes.

(self, item, stop=False)

Source from the content-addressed store, hash-verified

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."""

Callers 1

recipe-577654.pyFile · 0.80

Calls 1

DDEErrorClass · 0.85

Tested by

no test coverage detected