You will need to modify your C++ dll to fill supplied buffers instead of
allocating memory internally and returning pointer:
BOOL RSATest_GetKeyPair (BYTE *pubKey, BYTE *privKey, DWORD & dwPubKSize,
DWORD & dwPrivKSize)
On invoke dwPubKSize and dwPrivKSize should be set to the size of the
supplied buffers and upon return you will set them to the actual data size.
Make sure you check for that the buffers are sufficient
[DllImport("yourdll")]
extern public static bool RSATest_GetKeyPair (byte[] pubKey, byte[] privKey,
ref int dwPubKSize, ref int dwPrivKSize);
"Eduardo Pavinato Klein" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi.
>
> I have a Embedded C++ DLL that exports byte arrays. My export function
> header is:
>
> BOOL RSATest_GetKeyPair (BYTE **pubKey, BYTE **privKey, DWORD &
dwPubKSize,
> DWORD & dwPrivKSize)
>
> How do I do it on the .NET CF?
> I don't know how to retrieve byte arrays from unmanaged code.
>
> Thanks,
> Eduardo
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003
>
>