Delphi 2009: How to communicate between Windows service & desktop application under Vista?

后端 未结 6 1570
误落风尘
误落风尘 2020-12-01 09:57

How can a desktop application communicate with a Windows service under Vista/Windows2008/Windows7? The application needs to send small strings to the service and receive str

6条回答
  •  醉话见心
    2020-12-01 10:48

    Have a look at the answers in Exchange Data between two apps across PC on LAN which is pretty much the same question nowadays. Local comms via TCP is standard. As I said in my response there, solutions that use "Remote Procedure Call" type interfaces work well. I use RemObjects SDK for this sort of thing, and it makes it easy to expand to control across the network if you wish to later.

    Both of these allow you to create a connection that for most of your code is "transparent", and you just call an interface which sends the data over the wire and gets results back. You can then program how you usually do, and forget the details of sockets etc.

提交回复
热议问题