Discussion:
DDE Client without VCL/Forms
(too old to reply)
m***@gmx.de
2007-01-21 13:05:30 UTC
Permalink
Raw Message
Some years ago Peter Below (TeamB) posted a reply on this topic.

http://groups.google.de/group/borland.public.delphi.winapi/browse_frm/thread/b70f60e093fd9da3/e5ed16b34a9fd7c6?lnk=st&q=dde+api+unit&rnum=4#e5ed16b34a9fd7c6

I tried to contact Peter, but his email is not valid. May someone can
tell me how to contact Peter?

Or if Peter is still active here: Can you send me the units too?

regards
Michael
m***@gmx.de
2007-01-23 22:01:35 UTC
Permalink
Raw Message
I was searching for some more hours.

And now i am glad to report i found what i was searching for so long.

In this thread Peter was posting his units "DDEObjec" and "ErrClass":
http://groups.google.de/group/borland.public.delphi.vcl.components.using/browse_frm/thread/c81ee842ac98864d/7dc648027d4908a1?lnk=st&q=ddeml&rnum=1&hl=de#7dc648027d4908a1

And my problem seams to be solved. The units are working. Scroll down
for my example how to use the units.

Have fun.....


Michael



unit Unit1;

interface


uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, ExtCtrls, DDEObjec, DDEML;

type
TForm1 = class(TForm)
Memo1: TMemo;
edtService: TEdit;
edtTopic: TEdit;
edtMacro: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;


function DdeItemChange(CallType, Fmt: UINT; Conv: HConv; hsz1, hsz2:
HSZ; Data: HDDEData; Data1, Data2: DWORD): HDDEData; stdcall;

var
Form1: TForm1;

implementation

{$R *.DFM}

var
count: Integer = 0;
dde: TDDEMLClass;

function DdeItemChange(CallType, Fmt: UINT; Conv: HConv; hsz1, hsz2:
HSZ; Data: HDDEData; Data1, Data2: DWORD): HDDEData;
var
str:String;
begin
inc(count);
dde.GetDataAsStrObj(data, str);
Form1.Memo1.Lines.Add(IntToStr(count)+': '+str);
//result := data; when i give a result, my server app gets a timeout
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
dde := TDDEMLClass.Create(DDEItemChange, 0);
dde.Connect(PAnsiChar(edtService.Text), PAnsiChar(edtTopic.Text));
dde.Execute(PAnsiChar(edtMacro.Text));
end;

end.

Loading...