PC Review


Reply
Thread Tools Rate Thread

Marshalling ArrayList

 
 
Saad
Guest
Posts: n/a
 
      26th Sep 2008
Hi,

I have a struct as follows:

[StructLayout(LayoutKind::Sequential,CharSet=CharSet::Ansi)]
public __gc struct STTemp
{
public:
int someint;
System::Collections::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.
 
Reply With Quote
 
 
 
 
Pavel Minaev
Guest
Posts: n/a
 
      29th Sep 2008
On Sep 26, 7:09*pm, Saad <(E-Mail Removed)> wrote:
> Hi,
>
> I have a struct as follows:
>
> [StructLayout(LayoutKind::Sequential,CharSet=CharSet::Ansi)]
> public __gc struct STTemp
> {
> public:
> int someint;
> System::Collections::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?
 
Reply With Quote
 
 
 
 
Saad
Guest
Posts: n/a
 
      30th Sep 2008
On Sep 29, 1:13*pm, Pavel Minaev <(E-Mail Removed)> wrote:
> On Sep 26, 7:09*pm, Saad <(E-Mail Removed)> wrote:
>
> > Hi,

>
> > I have a struct as follows:

>
> > [StructLayout(LayoutKind::Sequential,CharSet=CharSet::Ansi)]
> > public __gc struct STTemp
> > {
> > public:
> > int someint;
> > System::Collections::ArrayList* arrTemp;

>
> > };

>
> > Now, i want to marshal this strcuture so that thearraylistgets
> > 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
 
Reply With Quote
 
Pavel Minaev
Guest
Posts: n/a
 
      1st Oct 2008
On Sep 30, 8:46*am, Saad <(E-Mail Removed)> wrote:
> On Sep 29, 1:13*pm, Pavel Minaev <(E-Mail Removed)> wrote:
>
>
>
>
>
> > On Sep 26, 7:09*pm, Saad <(E-Mail Removed)> wrote:

>
> > > Hi,

>
> > > I have a struct as follows:

>
> > > [StructLayout(LayoutKind::Sequential,CharSet=CharSet::Ansi)]
> > > public __gc struct STTemp
> > > {
> > > public:
> > > int someint;
> > > System::Collections::ArrayList* arrTemp;

>
> > > };

>
> > > Now, i want to marshal this strcuture so that thearraylistgets
> > > 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marshalling ArrayList Saad Microsoft Dot NET 0 26th Sep 2008 04:08 PM
a class inherited from ArrayList, is saved to ViewState, why the type of the object read from ViewSate is not the class, but the parent, ArrayList leal ting Microsoft ASP .NET 0 29th Dec 2003 08:08 AM
Adding an ArrayList to an ArrayList? Gustaf Liljegren Microsoft C# .NET 4 4th Nov 2003 01:27 PM
RE: Iterate through an ArrayList using values in another ArrayList Saravanan Rathinavelu Microsoft C# .NET 4 26th Aug 2003 08:00 PM
Iterate through ArrayList using an another ArrayList Saravanan Rathinavelu Microsoft ASP .NET 3 19th Aug 2003 08:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:35 AM.