Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:20:23+00:00 2026-06-17T19:20:23+00:00

I am writing an application in Delphi to connect to remote MQ Server and

  • 0

I am writing an application in Delphi to connect to remote MQ Server and get messages.
I installed a MQ Server on my comp and wrote a test application.
All well Connect,Open,Put,Get,.. all works well.
Then I tried to connect to remote MQ by changing address, it works but not correctly, it works with local MQ still and get info from local. not switched to other remote server!!!!
My source is as bellow, What I should do? Thanks

var
  QMgrName    : MQCHAR48;
  ConnectOpts : TMQCNO;
  ClientConn  : TMQCD;
  Compcode    : MQLONG;
  Reason      : MQLONG;
begin
  StrPCopy(QMgrName, AQueueManager+#0);
  ConnectOpts.StrucId := MQCNO_STRUC_ID;
  ConnectOpts.Version := MQCNO_VERSION_1;
  ConnectOpts.Options := MQCNO_STANDARD_BINDING;
  ConnectOpts.ClientConnOffset := 0;
  ConnectOpts.ClientConnPtr := @ClientConn;

  with ClientConn do begin
    StrPCopy(ClientConn.ConnectionName, format('%s(%s)'#0, [AIP,APort]));
    Version := MQCD_VERSION_6;
    ChannelType := MQCHT_CLNTCONN;
    TransportType := MQXPT_TCP;
    Desc := '';
    QMgrName := '';
    XmitQName := '';
    ShortConnectionName := '';
    MCAName := '';
    ModeName := '';
    TpName := '';
    BatchSize := 50;
    DiscInterval := 6000;
    ShortRetryCount := 10;
    ShortRetryInterval := 60;
    LongRetryCount := 999999999;
    LongRetryInterval := 1200;
    SecurityExit := '';
    MsgExit := '';
    SendExit := '';
    ReceiveExit := '';
    SeqNumberWrap := 999999999;
    MaxMsgLength := 4194304;
    PutAuthority := MQPA_DEFAULT;
    DataConversion := MQCDC_NO_SENDER_CONVERSION;
    SecurityUserData := '';
    MsgUserData := '';
    SendUserData := '';
    ReceiveUserData := '';
    UserIdentifier := '';
    Password := '';
    MCAUserIdentifier := '';
    MCAType := MQMCAT_PROCESS;
    ConnectionName := '';
    RemoteUserIdentifier := '';
    RemotePassword := '';
    MsgRetryExit := '';
    MsgRetryUserData := '';
    MsgRetryCount := 10;
    MsgRetryInterval := 1000;
    HeartbeatInterval := 1;
    BatchInterval := 0;
    NonPersistentMsgSpeed := MQNPMS_FAST;
    StrucLength := MQCD_LENGTH_6;
    ExitNameLength := MQ_EXIT_NAME_LENGTH;
    ExitDataLength := MQ_EXIT_DATA_LENGTH;
    MsgExitsDefined := 0;
    SendExitsDefined := 0;
    ReceiveExitsDefined := 0;
    MsgExitPtr := nil;
    MsgUserDataPtr := nil;
    SendExitPtr := nil;
    SendUserDataPtr := nil;
    ReceiveExitPtr := nil;
    ReceiveUserDataPtr := nil;
    ClusterPtr := nil;
    ClustersDefined := 0;
    NetworkPriority := 0;
    LongMCAUserIdLength := 0;
    LongRemoteUserIdLength := 0;
    LongMCAUserIdPtr := nil;
    LongRemoteUserIdPtr := nil;
//    MCASecurityId := MQSID_NONE_ARRAY;
//    RemoteSecurityId := MQSID_NONE_ARRAY;
  end;
  MQCONNX(@QMgrName, ConnectOpts, HConn,Compcode,Reason);
  if CompCode <> MQCC_OK then
    raise Exception.Create(format('MQCONNX Fail, Completion Code: %d, Reason: %d',[CompCode,Reason]));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:20:24+00:00Added an answer on June 17, 2026 at 7:20 pm

    The code snippet doesn’t show the uses statement. According to the MA7Q docs,

    The SupportPac contains two files called ‘MQI.PAS’ and ‘MQIC.PAS’.
    These are Pascal sources that should be placed somewhere in the Search
    Path of Delphi to be included in your Pascal program. The way to
    include it is like using any unit in Pascal:

    uses MQI;
    or
    uses MQIC;

    The MQI is the bindings mode (shared memory) connection and the MQIC is the client connection over the network stack.

    It is possible to have both available and let the application determine which to use at run-time. According to the WMQ Infocenter:

    If you are linking to the mqm library, then a standard server
    connection using the default bind type is attempted first. If the
    underlying server library failed to load, a client connection is
    attempted instead.

    This suggests to me that you have both libraries in the path and the connection is finding the local QMgr first and ignoring the client connection parameters, or perhaps that you are using the MQI library where you want the MQIC library. Make sure the MQIC library is in the path and change your uses statement.

    If switching the library does not alone solve the problem, consider specifying MQCNO_CLIENT_BINDING instead of MQCNO_STANDARD_BINDING.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a Delphi application that allows a user to connect to an
I'm writing a client-server win32 application in Delphi 7 and in a section i
I am writing a server application in Delphi 2009 that implements several types of
I'm writing a Delphi 7 application which needs to access the same SQL Server
I was writing a small console application in Delphi (XE), and by mistake wrote:
I'm writing a Delphi application in which I'm retrieving appointment data from Exchange Web
I am writing a VCL/Delphi Application, and I need to draw text onto a
I am writing application using c++, in windows. I want to get a thumbnail
I'm writing an application in Delphi 2010, and I'd like to provide the option
I'm writing a touchscreen enabled application in Delphi XE2. I have a form with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.