Author |
Message
|
IOPMG |
Posted: Fri Feb 14, 2003 4:53 am Post subject: RE: Delphi Files (CMQPAS.ZIP) |
|
|
Newbie
Joined: 14 Feb 2003 Posts: 2
|
Hi there
I am using the Delphi Files by Dinko Miljak to write a Delphi client application that connects to a queue manager on a server and either puts/gets a message on/from a queue.
Problem is the Delphi Client app works fine on the server but does not want to connect to the server from a remote client PC/workstation.
I have defined necessary Server Conn Channels. And I use the 'CONNX' call and have set the necessary parameters in the 'MQCNO' and 'MQCD' structures.
I have tested the connection with the 'AMQSCNXC' sample and it successfully gets the queue manager name from the server.
Any help would be appreciated.
Regards
IOPMG |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Feb 14, 2003 6:23 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well more detail about what is failing ie Reason Code and also details on the CONNX call _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
IOPMG |
Posted: Fri Feb 14, 2003 6:39 am Post subject: |
|
|
Newbie
Joined: 14 Feb 2003 Posts: 2
|
Okay,
The reason code that is returned is 0(completion code is 2), so I am unable to determine what type of error/reason for failing.
With the CONNX call, I am setting the CHANNELNAME, CONNECTIONNAME and QMGRNAME for the MQCD structure and thereafter set the CLIENTCONNPTR, in the MQCNO structure, to point to the MQCD structure.
Once this is done, the CONNX call is executed.
IOPMG |
|
Back to top |
|
 |
nstar |
Posted: Wed Dec 14, 2005 5:15 am Post subject: |
|
|
Newbie
Joined: 14 Dec 2005 Posts: 3
|
My Delphi code like this ,but it does not work,why?
the var already defined.
mqcd:=MQCD_CLIENT_CONN_DEFAULT;
mqcd.QMgrName:='CRMQM';
mqcd.ConnectionName:='132.228.63.199(16502)';
mqcd.ChannelName:='SYSTEM.ADMIN.SVRCONN';
ConnectOpts:=MQCNO_DEFAULT;
ConnectOpts.ClientConnPtr:=@mqcd;
ConnectOpts.Version:=MQCNO_VERSION_2;
MQCONNX(
'CRMQM',
ConnectOpts,
HConn,
CompCode,
CReason
);
Can you send me your sameles? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Dec 14, 2005 5:33 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You may need to rebuild your application to link against the client libraries rather than the server libraries.
I don't know Delphi well enough to say, but that's my guess. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
nstar |
Posted: Wed Dec 14, 2005 7:26 am Post subject: |
|
|
Newbie
Joined: 14 Dec 2005 Posts: 3
|
Thanks for reply.
What I used is downloaded from MQSeries.net.(repository/Delphi)
It can connect to localhost,but doesn't to remote.
I modified code like below,use the function from CMQPas.pas and CMQXPas.pas,also does not work.
-----------------------
setMQCNO_DEFAULT(ConnectOpts);
SetMQCD_CLIENT_CONN_DEFAULT(mqcd);
mqcd.QMgrName:='CRMQM';
mqcd.ConnectionName:='132.228.63.199(16502)';
mqcd.ChannelName:='SYSTEM.ADMIN.SVRCONN';
ConnectOpts.ClientConnPtr:=@mqcd;
ConnectOpts.Version:=MQCNO_VERSION_2;
MQCONNX(
'CRMQM',
ConnectOpts,
HConn,
CompCode,
CReason
); |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Dec 14, 2005 7:50 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
This is not a matter of the actual Pascal code.
It is a matter of the build or runtime environment. The Pascal code has to link against external libraries to execute the MQ calls that you have put into it. If your code is working to connect to a local qmgr, then you are linking against the server libraries. To get it to connect to a remote qmgr, you need to link against the client libraries.
This assumes that you have done all of the normal things to test that you can actually establish an MQ connection to the remote queue manager OUTSIDE your code. A hint is to use the client version of a sample program with the MQSERVER environment variable.
Good luck! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
nstar |
Posted: Wed Dec 14, 2005 7:53 pm Post subject: |
|
|
Newbie
Joined: 14 Dec 2005 Posts: 3
|
Thanks for your help!
Yes,I can use MQ Explorer connect to remote MQManager, IP and CHANNNE like the desc in delphi code.
I reference some VC++ code( it do work) ,what I var set like VC++ code,but still the same result. |
|
Back to top |
|
 |
gunter |
Posted: Tue Dec 20, 2005 2:09 am Post subject: |
|
|
Partisan
Joined: 21 Jan 2004 Posts: 307 Location: Germany, Frankfurt
|
Do you have still this problem ? I looked in Delphi code and found lines like this:
Code: |
external 'mqm.dll' name 'MQPUT'; |
mqm.dll refers to the Server lib, to use the client library you have to change mqm.dll to the right client-library.
I found this here: http://www.torry.net/pages.php?id=353 _________________ Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3 |
|
Back to top |
|
 |
|