A
Ananas
Hi,
Please give me an idea how to send a static array from dll written on
C++ to C# application.
This is a C++ code:
const SIGNATURE_LENGTH = 50;
struct Info
{
unsigned int Signature[SIGNATURE_LENGTH];
}
This is a C# code:
[StructLayout( LayoutKind.Sequential, CharSet = CharSet.Unicode )]
public struct Info
{
[MarshalAs(UnmanagedType.ByValArray,SizeConst=50)]
uint[] Signature;
}
The problem is that I have to specify the length of the static array to
be marshalled from dll. But if the length changes in future then I have
to rebuild my c# code according with new static array length?
How to make universal C# code for to marshal static array inside the
structure?
Thanks in advise,
Eugene.
Please give me an idea how to send a static array from dll written on
C++ to C# application.
This is a C++ code:
const SIGNATURE_LENGTH = 50;
struct Info
{
unsigned int Signature[SIGNATURE_LENGTH];
}
This is a C# code:
[StructLayout( LayoutKind.Sequential, CharSet = CharSet.Unicode )]
public struct Info
{
[MarshalAs(UnmanagedType.ByValArray,SizeConst=50)]
uint[] Signature;
}
The problem is that I have to specify the length of the static array to
be marshalled from dll. But if the length changes in future then I have
to rebuild my c# code according with new static array length?
How to make universal C# code for to marshal static array inside the
structure?
Thanks in advise,
Eugene.