Hi, I wanted to convert array< Byte>^ to unsigned char*. I have tried to explain what i have done. I donot know how to proceed further. Please show me the right approach. I am using MS VC 2005.
//Managed array
array<Byte>^ vPublicKey = vX509->GetPublicKey();
//Unmanaged array
unsigned char vUnmanagedPublicKey[MAX_PUBLIC_KEY_SIZE];
ZeroMemory(vUnmanagedPublicKey,MAX_PUBLIC_KEY_SIZE);
//MANAGED ARRAY to UNMANAGED ARRAY
// Initialize unmanged memory to hold the array.
vPublicKeySize = Marshal::SizeOf(vPublicKey[0]) * vPublicKey->Length;
IntPtr vPnt = Marshal::AllocHGlobal(vPublicKeySize);
// Copy the Managed array to unmanaged memory.
Marshal::Copy(vPublicKey,0,vPnt,vPublicKeySize);
Here vPnt is a number. But how can copy the data from vPublicKey in to vUnmanagedPublicKey.
Thank you
Raj