Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ddeserver.py 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # 'Request' example added jjk 11/20/98
  2. import dde
  3. import win32ui
  4. from pywin.mfc import object
  5. class MySystemTopic(object.Object):
  6. def __init__(self):
  7. object.Object.__init__(self, dde.CreateServerSystemTopic())
  8. def Exec(self, cmd):
  9. print("System Topic asked to exec", cmd)
  10. class MyOtherTopic(object.Object):
  11. def __init__(self, topicName):
  12. object.Object.__init__(self, dde.CreateTopic(topicName))
  13. def Exec(self, cmd):
  14. print("Other Topic asked to exec", cmd)
  15. class MyRequestTopic(object.Object):
  16. def __init__(self, topicName):
  17. topic = dde.CreateTopic(topicName)
  18. topic.AddItem(dde.CreateStringItem(""))
  19. object.Object.__init__(self, topic)
  20. def Request(self, aString):
  21. print("Request Topic asked to compute length of:", aString)
  22. return str(len(aString))
  23. server = dde.CreateServer()
  24. server.AddTopic(MySystemTopic())
  25. server.AddTopic(MyOtherTopic("RunAnyCommand"))
  26. server.AddTopic(MyRequestTopic("ComputeStringLength"))
  27. server.Create("RunAny")
  28. while 1:
  29. win32ui.PumpWaitingMessages(0, -1)