1 Reply Latest reply on Mar 26, 2013 6:39 AM by 932778

    MessageQ API in C#


      Does anyone port MessageQ APIs successfully to C# 2005?

      For example, pams_attach_q in C# can be defined as below...

      public static extern int pams_attach_q(ref int attachmode, ref q_address qattached,
      ref int qtype, ref string qname, ref int q_namelen,
      int[] namespacelist, ref int namespacelistlen,
      ref int timeout, string arg2, string arg3);

      public struct q_address
      public int all;
      public int queue;
      public int group;

      Even though I defined them through DllImport, API does not seem to be working. I'm not really sure all the structures and parameters are properly defined.

      Can someone point me to the right direction?

        • 1. Re: MessageQ API in C#
          Hi Ramesh,

          I'm not that familiar with C#, but struct q_address is a union in original OMQ API:
          typedef struct groupqueue {
          int16 queue;
          int16 group;
          } group_queue;
          *typedef union qaddress {*
          int32 all;
          group_queue au;
          *} q_address;*

          So it looks to me your definition for q_address in C# is not what asked.