【问题标题】:Getting two value from my dll从我的 dll 中获取两个值
【发布时间】:2014-07-31 21:43:59
【问题描述】:
puplic class Example;
{
   public static int Test(int[] Array, int value1, int value2)
      {
         // here I calculate my value1 and value2 by using my Array
      }
}

上面是我的dll。然后我想在下面的 Windows 应用程序中调用我的 dll。

private void buttonStart_click(object sender, EventArgs e)
{
    int value1=0, value2=0;
    Example.Test(Array,value1,value2);
}

我的数组是全局定义的。在我的 windows 应用程序中,我想调用我的 dll 并在 dll 中计算我的新 value1 和 value2 然后将 windows 应用程序中的 value1 和 value2 更改为新的 value1 和 value2。

我是使用 dll 的新手。我可以使用 'return value1;' 从我的 dll 中返回一个值但我不知道如何从我的 dll 中获取两个值。

有人知道路吗?

【问题讨论】:

  • 你想通过引用传递吗?

标签: c# dll windows-applications


【解决方案1】:

试试

public static int Test(int[] Array, out int value1, out int value2)

public static int Test(int[] Array, ref int value1, ref int value2)

Passing Parameters (C# Programming Guide)

【讨论】:

    猜你喜欢
    • 2015-12-11
    • 1970-01-01
    • 2020-11-22
    • 2020-09-09
    • 2023-03-20
    • 2021-03-04
    • 2013-06-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多