M
MR
I am new to VS.C++ and am having a hard time when i have to share data
between managed and unmanaged code.
For example, I need to read binary data from a file and then call an non-CLR
dll function passing the data that was read as a void*
below is a snippet of the code that i have written in an attempt to do this.
I tried __pin but that is no longer supported in VS.2005.
is there a better way than reading into the array as I did?
How do you do this?
thanks for your help
m
struct UnmanagedValues // create a struct to hold all nonManaged values.
{
void * buffer;
} unManagedValues;
array<wchar_t>^ charBuffer = r->ReadChars(bufferSize); // read the data
into a managed array.
unManagedValues.buffer = &charBuffer; //but now I need to set the address of
the array as a void*. of course this line generates an error
between managed and unmanaged code.
For example, I need to read binary data from a file and then call an non-CLR
dll function passing the data that was read as a void*
below is a snippet of the code that i have written in an attempt to do this.
I tried __pin but that is no longer supported in VS.2005.
is there a better way than reading into the array as I did?
How do you do this?
thanks for your help
m
struct UnmanagedValues // create a struct to hold all nonManaged values.
{
void * buffer;
} unManagedValues;
array<wchar_t>^ charBuffer = r->ReadChars(bufferSize); // read the data
into a managed array.
unManagedValues.buffer = &charBuffer; //but now I need to set the address of
the array as a void*. of course this line generates an error