Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 31st, 2005, 03:25 AM
Andrew Nefiodovas
Guest
 
Posts: n/a
Default Unmanaged void* to .Net System::Array

I have an unmanaged C++ class representing a 2D matrix. It holds a
pointer to a block with the actual data, and fields indicating the
number, size and type of the matrix elements. Like this:

public class UnmanagedMatrix {
public:
void * block;
long rows;
long cols;
int type; //refers to an enum of possible types - char, long, double,
etc.
long sizeOfBlockType;
....
}

I am writing a managed wrapper to use this class from within .Net with
a member pointer to the unmanaged class in the usual way:

public __gc class ManagedMatrix {
private:
UnmanagedMatrix __nogc* pM;
....
}

I need the wrapper class to get and set the unmanaged block of matrix
data using System.Arrays. i.e I need methods like this:

public:
System.Array getData() {}
void setData(System.Array data) {} // maybe pass in the type as well?

Any help with these two methods would be appreciated.
I am not at liberty to modify the unmanaged class.
I am a C++ novice.

  #2  
Old August 31st, 2005, 03:55 AM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: Unmanaged void* to .Net System::Array

Andrew Nefiodovas wrote:[color=blue]
> I have an unmanaged C++ class [...]
> I am writing a managed wrapper to use this class from within .Net [...]
>
> Any help with these two methods would be appreciated.
> I am not at liberty to modify the unmanaged class.
> I am a C++ novice.[/color]


Please post to 'microsoft.public.vc.language'. "Managed" is off-topic
here. Here we discuss _only_ standard C++ language.


  #3  
Old August 31st, 2005, 04:15 AM
Andrew Nefiodovas
Guest
 
Posts: n/a
Default Re: Unmanaged void* to .Net System::Array

oops, sorry

 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles