我想在DELPHI中创建消息对列
找到下面这一段资料“首先引入MSMQ的类型库,就会产生一些控件在Active里 ”
请问有那为知道这个类型库在那引入,如果需要下载有谁知道地方的??正好,前段时间做过一个小程序,是关于这方面的
首先引入MSMQ的类型库,就会产生一些控件在Active里 发:
procedure TForm1.Button1Click(Sender: TObject);var
MSMQQInfo: Variant;
begin MSMQQInfo := CreateOleObject('MSMQ.MSMQQueueInfo');
MSMQQInfo.PathName := '.\private$\Test';
try
MSMQQInfo.Create; //出错误提示信息
except
end;
MSMQQueueInfo1.PathName := '.\private$\Test';
MSMQQueueInfo1.Label_ :='ss';
MSMQMessage1.Label_ := 'bb';
MSMQMessage1.Body := 'kk';
msmqqueue1.ConnectTo(MSMQQueueInfo1.Open(MQ_SEND_ACCESS, 0));
MSMQMessage1.Send(MSMQQueueInfo1.Open(MQ_SEND_ACCESS, MQ_DENY_NONE));
end;
收:
procedure TForm1.Button4Click(Sender: TObject);
begin
msmqqueueinfo1.PathName := '.\private$\Test'';
msmqqueue1.Disconnect;
msmqqueue1.ConnectTo(msmqqueueinfo1.Open(1, 0));
msmqqueue1.EnableNotification(MSMQEvent1.DefaultInterface);
end;处理:
procedure TForm1.MSMQEvent1Arrived(Sender: TObject; var Queue: OleVariant;
Cursor: Integer);
var
Msg: Variant;
ss: string;begin
Msg := Queue.Receive;
ss:= Msg.body;
// 处理程序
end;你看够不够用?
:)
找到下面这一段资料“首先引入MSMQ的类型库,就会产生一些控件在Active里 ”
请问有那为知道这个类型库在那引入,如果需要下载有谁知道地方的??正好,前段时间做过一个小程序,是关于这方面的
首先引入MSMQ的类型库,就会产生一些控件在Active里 发:
procedure TForm1.Button1Click(Sender: TObject);var
MSMQQInfo: Variant;
begin MSMQQInfo := CreateOleObject('MSMQ.MSMQQueueInfo');
MSMQQInfo.PathName := '.\private$\Test';
try
MSMQQInfo.Create; //出错误提示信息
except
end;
MSMQQueueInfo1.PathName := '.\private$\Test';
MSMQQueueInfo1.Label_ :='ss';
MSMQMessage1.Label_ := 'bb';
MSMQMessage1.Body := 'kk';
msmqqueue1.ConnectTo(MSMQQueueInfo1.Open(MQ_SEND_ACCESS, 0));
MSMQMessage1.Send(MSMQQueueInfo1.Open(MQ_SEND_ACCESS, MQ_DENY_NONE));
end;
收:
procedure TForm1.Button4Click(Sender: TObject);
begin
msmqqueueinfo1.PathName := '.\private$\Test'';
msmqqueue1.Disconnect;
msmqqueue1.ConnectTo(msmqqueueinfo1.Open(1, 0));
msmqqueue1.EnableNotification(MSMQEvent1.DefaultInterface);
end;处理:
procedure TForm1.MSMQEvent1Arrived(Sender: TObject; var Queue: OleVariant;
Cursor: Integer);
var
Msg: Variant;
ss: string;begin
Msg := Queue.Receive;
ss:= Msg.body;
// 处理程序
end;你看够不够用?
:)
解决方案 »
- delphi如何能识别并显示多种语种的文件啊?比如说俄文。
- 忘了hellolongbin(一个人[终不似,少年游]) 的100
- textfile文件读一行给变量t,然后在t中查找字符串,pos(..),出现怪现象。
- 执行窗体创建时form.create会内存报错,说是违反内存规则,请问这是什么问题,如何解决?
- OpenProcess问题?
- 如何动态加载JPG图片?
- 菜鸟求助
- 请问:有没有像写字板一样的对文本进行操作的全程……或文档?
- 有办法让资源文件里的BITMAP支持256色以上的色彩吗?
- 急!请问有没有直接用于Delphi的CASE工具?
- 为什么在多线程中使用Synchronize()函数?
- 如何在TreeView控件的每个节点中添加隐藏信息。
// MSMQQInfo.Create; //出错误提示信息 ,--多余的!