N
Nstar
Unregistered / Unconfirmed
GUEST, unregistred user!
我有一个MQI.pas的文件,网上搜索可以用这个来读取MQ消息,但我试了一下好像不行,现求这样的程序示例,不是读取本机队列的,是读取远程机器的队列管理器。
我的代码如下:
procedure TfrmMQSeries.N1Click(Sender: TObject);
var
QMgrName:MQCHAR48;
ConnectOpts:MQCNO;
Hconn:MQHCONN;
Compcode,Reason:MQLONG;
mqcds:MQCD;
begin
QMgrName:='CRMQM'#0;
ConnectOpts := MQCNO_DEFAULT;
mqcds:= MQCD_CLIENT_CONN_DEFAULT;
mqcds.ConnectionName:='132.228.63.199(16502)';
mqcds.ChannelName:='SYSTEM.ADMIN.SVRCONN';
ConnectOpts.ClientConnPtr:=@mqcds;
ConnectOpts.Version:=MQCNO_VERSION_2;
MQCONNX(@QMgrName,@ConnectOpts,@Hconn,@Compcode,@Reason);
if Compcode=MQCC_FAILED then
begin
frmReasonCode.ledCode.Text:=inttostr(Reason);
frmReasonCode.ShowModal;
end;
end;
我的代码如下:
procedure TfrmMQSeries.N1Click(Sender: TObject);
var
QMgrName:MQCHAR48;
ConnectOpts:MQCNO;
Hconn:MQHCONN;
Compcode,Reason:MQLONG;
mqcds:MQCD;
begin
QMgrName:='CRMQM'#0;
ConnectOpts := MQCNO_DEFAULT;
mqcds:= MQCD_CLIENT_CONN_DEFAULT;
mqcds.ConnectionName:='132.228.63.199(16502)';
mqcds.ChannelName:='SYSTEM.ADMIN.SVRCONN';
ConnectOpts.ClientConnPtr:=@mqcds;
ConnectOpts.Version:=MQCNO_VERSION_2;
MQCONNX(@QMgrName,@ConnectOpts,@Hconn,@Compcode,@Reason);
if Compcode=MQCC_FAILED then
begin
frmReasonCode.ledCode.Text:=inttostr(Reason);
frmReasonCode.ShowModal;
end;
end;