Marshalling ArrayList

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Saad

    Marshalling ArrayList

    Hi,

    I have a struct as follows:

    [StructLayout(La youtKind::Seque ntial,CharSet=C harSet::Ansi)]
    public __gc struct STTemp
    {
    public:
    int someint;
    System::Collect ions::ArrayList * arrTemp;
    };

    Now, i want to marshal this strcuture so that the arraylist gets
    marshalled properly...
    But i dont understand how to use the "MarshalAl" attribute in the case
    of arraylist....

    Any help will be appreciated...

    Thanks in advance...
    Saad.
  • Pavel Minaev

    #2
    Re: Marshalling ArrayList

    On Sep 26, 7:09 pm, Saad <saadthel...@gm ail.comwrote:
    Hi,
    >
    I have a struct as follows:
    >
    [StructLayout(La youtKind::Seque ntial,CharSet=C harSet::Ansi)]
    public __gc struct STTemp
    {
    public:
    int someint;
    System::Collect ions::ArrayList * arrTemp;
    >
    };
    >
    Now, i want to marshal this strcuture so that the arraylist gets
    marshalled properly...
    What exactly do you mean by "marshalled properly"? How do you want it
    to be marshalled?

    Comment

    • Saad

      #3
      Re: Marshalling ArrayList

      On Sep 29, 1:13 pm, Pavel Minaev <int...@gmail.c omwrote:
      On Sep 26, 7:09 pm, Saad <saadthel...@gm ail.comwrote:
      >
      Hi,
      >
      I have a struct as follows:
      >
      [StructLayout(La youtKind::Seque ntial,CharSet=C harSet::Ansi)]
      public __gc struct STTemp
      {
      public:
      int someint;
      System::Collect ions::ArrayList * arrTemp;
      >
      };
      >
      Now, i want to marshal this strcuture so that thearraylistget s
      marshalled properly...
      >
      What exactly do you mean by "marshalled properly"? How do you want it
      to be marshalled?
      Hi Pavel,

      I have a vector at the unmanaged end....and corresponding to that i
      have taken an arraylist here...in managed world...
      So, now i would like to somehow, marshal the arraylist ( which holds
      objects of another structure ) to the unmanaged vector class....

      Please let me know how can i achieve this? Through custom marshaller ?

      Saad

      Comment

      • Pavel Minaev

        #4
        Re: Marshalling ArrayList

        On Sep 30, 8:46 am, Saad <saadthel...@gm ail.comwrote:
        On Sep 29, 1:13 pm, Pavel Minaev <int...@gmail.c omwrote:
        >
        >
        >
        >
        >
        On Sep 26, 7:09 pm, Saad <saadthel...@gm ail.comwrote:
        >
        Hi,
        >
        I have a struct as follows:
        >
        [StructLayout(La youtKind::Seque ntial,CharSet=C harSet::Ansi)]
        public __gc struct STTemp
        {
        public:
        int someint;
        System::Collect ions::ArrayList * arrTemp;
        >
        };
        >
        Now, i want to marshal this strcuture so that thearraylistget s
        marshalled properly...
        >
        What exactly do you mean by "marshalled properly"? How do you want it
        to be marshalled?
        >
        Hi Pavel,
        >
        I have a vector at the unmanaged end....and corresponding to that i
        have taken an arraylist here...in managed world...
        So, now i would like to somehow, marshal the arraylist ( which holds
        objects of another structure ) to the unmanaged vector class....
        I assume that by vector you mean std::vector here; if so, then there's
        no way you can use the standard .NET P/Invoke marshalling to get it -
        not with ArrayList, not with plain arrays, etc.

        I have to ask, though - since you're using Managed C++, why don't you
        just directly invoke those C++ APIs from your code?

        Comment

        Working...