如何在Borland C ++中调用返回字符串数组的方法? [英] How to call a method that returns an array of strings in Borland C++?
本文介绍了如何在Borland C ++中调用返回字符串数组的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在C#中使用返回字符串数组的方法创建了一个COM包装器:
public string [] GetArrayOfStrings()
{
string [] array = new string [ 3 ];
array [ 0 ] = first 跨度>;
array [ 1 ] = second 跨度>;
array [ 2 ] = third 跨度>;
return 数组;
}
在VB6中,我调用该方法并在列表中显示如下字符串:
Dim s()作为 字符串
s = obj.GetArrayOfStrings()
对于 i = LBound(s)要 UBound(s)
List1.AddItem s(i)
下一步 i
有没有人知道如何从Borland C ++调用该方法并获取返回数组中的所有元素?
解决方案
Remy Lebeau解决了我的问题。这是链接
I've created a COM wrapper in C# with a method that returns an array of strings:
public string[] GetArrayOfStrings()
{
string[] array = new string[3];
array[0] = "first";
array[1] = "second";
array[2] = "third";
return array;
}
In VB6 I'm calling that method and presenting strings in a list like this:
Dim s() As String
s = obj.GetArrayOfStrings()
For i = LBound(s) To UBound(s)
List1.AddItem s(i)
Next i
Does anyone know how to call that method from Borland C++ and get all elements in the returning array?
解决方案
Remy Lebeau solved my problem. Here is the link
这篇关于如何在Borland C ++中调用返回字符串数组的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文