晨
晨空
Unregistered / Unconfirmed
GUEST, unregistred user!
我做了个dde的程序,客气端‘发送宏’的代码如下,
procedure TForm2.Button2Click(Sender: TObject);
VAR str:string;
begin
ddeclientconv1.SetLink(edit2.Text,edit3.Text);
if ddeclientconv1.OpenLink=true then
begin
ddeclientconv1.ServiceApplication:=edit4.Text;
if (ddeclientconv1.ExecuteMacro(PCHAR('SHOW1'),false)=false) then
showmessage('wrong');
ddeclientconv1.CloseLink;
end
else showmessage('failure');
end;
为什么执行了这个过程后
服务器端执行宏程序并没有执行?下面这段代码程序根本就没有执行,这是为什么,哪里做
得不对吗?高手请教
procedure TForm1.DdeServerConv1ExecuteMacro(Sender: TObject;
Msg: TStrings);
VAR Macro:string;
begin
if Msg.Count<>0 then
begin
macro:=msg.Strings[0];
if macro='show1' then
image1.Picture.LoadFromFile('1.bmp')
else if macro='show2' then
image1.Picture.LoadFromFile('2.bmp')
else showmessage('not support the command');
end;
end;
procedure TForm2.Button2Click(Sender: TObject);
VAR str:string;
begin
ddeclientconv1.SetLink(edit2.Text,edit3.Text);
if ddeclientconv1.OpenLink=true then
begin
ddeclientconv1.ServiceApplication:=edit4.Text;
if (ddeclientconv1.ExecuteMacro(PCHAR('SHOW1'),false)=false) then
showmessage('wrong');
ddeclientconv1.CloseLink;
end
else showmessage('failure');
end;
为什么执行了这个过程后
服务器端执行宏程序并没有执行?下面这段代码程序根本就没有执行,这是为什么,哪里做
得不对吗?高手请教
procedure TForm1.DdeServerConv1ExecuteMacro(Sender: TObject;
Msg: TStrings);
VAR Macro:string;
begin
if Msg.Count<>0 then
begin
macro:=msg.Strings[0];
if macro='show1' then
image1.Picture.LoadFromFile('1.bmp')
else if macro='show2' then
image1.Picture.LoadFromFile('2.bmp')
else showmessage('not support the command');
end;
end;