 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jan 24, 2007 4:01 am Post subject: Re: DDE Client without VCL/Forms |
|
|
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. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|