I have somethin like that:
function DDE_Read(Service, Topic, Items: string): string;
var
DDE: TDDEClientConv;
begin
try
DDE := TDDEClientConv.Create(nil);
DDE.SetLink(Service, Topic);
DDE.OpenLink;
Result:=DDE.RequestData(Items);
finally
DDE.Free;
end;
end;
I connect to DDE server and get data. Sometimes I can get data and sometimes I receive empty string. Can you tell me is this code ok? How often I can connect to dde server to get data?
Have you maybe some *dll or your own code?
//EDIT Im beginer and I dont now always what you mean :) I am very grateful that you're helping me. So my code should be smth like that?
function DDE_Read(Service, Topic, Items: string): string;
var
DDE: TDDEClientConv;
temp:PAnsiCHar;
begin
DDE := TDDEClientConv.Create(nil);
DDE.SetLink(Service, Topic);
DDE.OpenLink;
try
temp:=DDE.RequestData(Items);
Result:=temp;
SysUtils.StrDispose(temp);
finally
DDE.Free;
end;
end;
StrDisposeto prevent memory leaks ->TDdeClientConv.RequestData- Sir RufoDdeGetLastError(ddeMgr.DdeInstId)for when the response is empty. Let's see if it returns a useful DMLERR. Use 'ddeml'. - Sertac Akyuz