Hi
I'm new in VC++ and have a question to generics. I have a generic
class, which contains an array of the generic type. This array I can
pin and then I would like to get an unmanaged pointer to it. Therefore
I wanted to creat a class member which represents the pointer to the
array. Unfortunately I get the folowring compile error for the code
beneath:
error C3229: 'DataType *' : indirections on a generic type parameter
are not allowed
Is there a posible way to get a this unmanaged pointer? My problem is
that it isn't allowed to creat a pin_ptr<DataTyp eas a class member
and it takes quite a while to do it every function call. Or, do I I
realy have to do a hack and creat a void* from the array by using
GCHandle::Alloc (...).AddrOfPin nedObject().ToP ointer() and then cast it
to a byte* and shift it each time by sizeof(DataType )?
By the way, my generic typs are never reference objects, only value
structs and data types like int, byte, ... .
Thanks for any help!
Thorsten
generic<typenam e DataTypepublic ref class RingBuffer
{
array<DataType^ m_Buffer;
DataType *m_Buffer_Ptr; // Error
}