C#: - P / invoke签名

时间:2010-03-11 09:01:49

标签: c# c++ c pinvoke

我在C ++中有一个带有以下签名的dll。它在c ++中工作;

    void Decompress(unsigned char *in,int in_len,unsigned char * out,
unsigned *o_len,int *e);

参数说明

  1. * in :传递给字节数组 功能
  2. in_len :第一个参数中的字节长度。
  3. * out :这将是字节数组的输出。
  4. * o_len :第三个​​参数中没有字节
  5. * e :返回错误代码
  6. 如何从c#中调用它?

    什么是P / Invoke声明?

1 个答案:

答案 0 :(得分:5)

static extern void Decompress(
                byte[] input, 
                int in_len,
                byte[] output, 
                ref int o_len,
                out int e);