views:

155

answers:

2

I have a third party tool that can send or receive DDE pokes. I have been using DDE spy to monitor communications between it and a 3rd party DDE server emulator, with a view to replicate this using Powerbuilder. As far as I can tell, this is using warm links. I tried using openchannel, followed by execremote, but the type of call is described as 'execute'. Likewise, when the client and the emulator start up, they appear in the list of registered servers, but my application doesn't/ I considered using user32.dll, but I understand that most of the DDE calls won't work with Powerbuilder since PB doesn't support callbacks. Can anybody point me in the direction of information on this area? ..... After a bit more tweaking, I tried opening a hotlink. Clicking the 'poke' button on the application, my powerbuilder has the hotlinkalarm event triggered. I can pick up the source etc, but no data. Also I need to send an instruction back, but all respondremote will do is send true or false. I have some Delphi / Pascal code from the DDE emulator, but the DDE calls look rather different to the Powerbuilder ones.

A: 

Did you find an answer for this? I'm not sure if I fully understand what you are doing, but here are things I think you need to look at.

StartServerDDE function establishes your application as a DDE server, note that you must have a window open as handle for DDE conversation, and then code window events (application level events won't work). This might be why you didn't see registered server. Use StopServerDDE when ending DDE server.

Code for the following events in DDE server window to accomplish receiving, sending data as your requirements need, all are :

RemoteExec event (client has sent a request) Use GetCommandDDE to get a command string the client sent Use GetCommandDDEOrigin to see what client application name sent the command

RemoteSend event (client has sent data) Use GetDataDDE to get data (via ref string) from client application Use GetDataDDEOrigin to see what client app sent the data

RemoteRequest event (client has requested data) Use SetDataDDE to send data to your client DDE application

I hope this helps.

DisplacedGuy
A: 

Thanks. I was trying to use DDE functionality in the 3rd party product to control it and extract data. In the end I got the link working, but my management lost interest in the project and it was abandoned.

David