A
Albertas
Hello,
I have function written in unmanaged environment, which takes as
parameters char*. For example:
void function(char *input, char *output);
It takes two char arrays and modifies the output char array. Now when i
try to use it in managed environment, i do this:
[DllImport("dll.dll", EntryPoint="function",
ExactSpelling=false, SetLastError=true)]
public unsafe static extern void
function([MarshalAs(UnmanagedType.LPArray)] char[] input,
[MarshalAs(UnmanagedType.LPArray)] ref char[] output);
Also tried byte[] instead of char.
When i call it i use:
function (input, ref output);
The problem is when i call this function, the output char array has
only one member in it, but there should be more. What I'm doing
wrong?
The function dll is not a COM object.
Thank You
I have function written in unmanaged environment, which takes as
parameters char*. For example:
void function(char *input, char *output);
It takes two char arrays and modifies the output char array. Now when i
try to use it in managed environment, i do this:
[DllImport("dll.dll", EntryPoint="function",
ExactSpelling=false, SetLastError=true)]
public unsafe static extern void
function([MarshalAs(UnmanagedType.LPArray)] char[] input,
[MarshalAs(UnmanagedType.LPArray)] ref char[] output);
Also tried byte[] instead of char.
When i call it i use:
function (input, ref output);
The problem is when i call this function, the output char array has
only one member in it, but there should be more. What I'm doing
wrong?
The function dll is not a COM object.
Thank You