我放弃了找到适合以下方法的数据类型:
我有COM对象方法,它需要“BSTR字符串的向量”(如COM文档所述)。它完美地起作用:a)python(一切都可以从python BTW开始)
Visum.Net.Zones.GetmultipleAttributes(["No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"])b)VBS:
Visum.Net.Zones.GetmultipleAttributes(Array("No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"))c)但没有什么可以用VB(引发'CComBaseContainer :: GetMultipleAttributes failed'错误)
它尝试了这样的方法Out=Visum.Net.Zones.GetmultipleAttributes(In)以及以下数据类型,每次都有相同的错误:
Dim Out As Object Dim In As New List(Of String) Dim In(2) As String In.toArray()我怎么能满足这个方法呢?
PS。 从文档引用:
GetMultipleAttributes([in] VARIANT AttrIDs,[out,retval] VARIANT * value) 返回容器的所有网络对象的多个属性的值。 必须将属性ID指定为BSTR字符串的向量。 返回值包含VARIANT值矩阵,其中包含所有对象和指定属性的值。 矩阵的行对应于标准顺序的网络对象(按其键排序)。 列对应于指定顺序中的属性。 参数[in] VARIANT AttrIDs在ATTRIBUTE.XLS中的Vectorof属性ID。 [out,retval] VARIANT * value容器中所有网络对象的这些属性值的矩阵
在此先感谢i2
I gave in with finding data type that would fit following method:
I have COM object method which requires "vector of BSTR strings" (as COM documentation says).It works perfectly from: a) python (everything works from python BTW)
Visum.Net.Zones.GetmultipleAttributes(["No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"])b) VBS:
Visum.Net.Zones.GetmultipleAttributes(Array("No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"))c) but nothing can go with VB ('CComBaseContainer::GetMultipleAttributes failed' error is raised)
it tried such method Out=Visum.Net.Zones.GetmultipleAttributes(In) with following data types, everytime the same error:
Dim Out As Object Dim In As New List(Of String) Dim In(2) As String In.toArray()How can I satisfy this method?
PS. Quote from documentation:
GetMultipleAttributes ( [in] VARIANT AttrIDs, [out, retval] VARIANT *value) Returns the values of several attributes for all net objects of the container. The attribute ID have to be specified as a vector of BSTR strings. The return value contains a matrix of VARIANT values consisting of the values of all objects and specified attributes. The rows of the matrix correspond to the net objects in standard order (ordered by their keys). The columns correspond to the attributes in the order as specified. Parameters [in] VARIANT AttrIDs Vectorof attribute IDs as in ATTRIBUTE.XLS. [out, retval] VARIANT *value Matrix of values of these attributes for all net objects in the container
Thanks in advance i2
最满意答案
如果这在VBS中有效:
Visum.Net.Zones.GetmultipleAttributes(Array("No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"))这应该在VB.NET中工作:
Dim a() As String= New String() {"No", "Name", "XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"} Visum.Net.Zones.GetmultipleAttributes(a) 'you might need a() instead看看这个问题是为了澄清: VB.NET中Array()的等价物?
The following finally worked, but don't ask me why:
Dim In() As Object = {"No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"} Dim VisumOut(,) As Object VisumOut = Visum.Net.Zones.GetMultipleAttributes(In)After million of tries it finally went fine. If you know why is that, please give us proper answer.
Powodzenia, Rafał!
将字符串数组传递给COM对象(pass array of strings into COM object)我放弃了找到适合以下方法的数据类型:
我有COM对象方法,它需要“BSTR字符串的向量”(如COM文档所述)。它完美地起作用:a)python(一切都可以从python BTW开始)
Visum.Net.Zones.GetmultipleAttributes(["No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"])b)VBS:
Visum.Net.Zones.GetmultipleAttributes(Array("No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"))c)但没有什么可以用VB(引发'CComBaseContainer :: GetMultipleAttributes failed'错误)
它尝试了这样的方法Out=Visum.Net.Zones.GetmultipleAttributes(In)以及以下数据类型,每次都有相同的错误:
Dim Out As Object Dim In As New List(Of String) Dim In(2) As String In.toArray()我怎么能满足这个方法呢?
PS。 从文档引用:
GetMultipleAttributes([in] VARIANT AttrIDs,[out,retval] VARIANT * value) 返回容器的所有网络对象的多个属性的值。 必须将属性ID指定为BSTR字符串的向量。 返回值包含VARIANT值矩阵,其中包含所有对象和指定属性的值。 矩阵的行对应于标准顺序的网络对象(按其键排序)。 列对应于指定顺序中的属性。 参数[in] VARIANT AttrIDs在ATTRIBUTE.XLS中的Vectorof属性ID。 [out,retval] VARIANT * value容器中所有网络对象的这些属性值的矩阵
在此先感谢i2
I gave in with finding data type that would fit following method:
I have COM object method which requires "vector of BSTR strings" (as COM documentation says).It works perfectly from: a) python (everything works from python BTW)
Visum.Net.Zones.GetmultipleAttributes(["No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"])b) VBS:
Visum.Net.Zones.GetmultipleAttributes(Array("No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"))c) but nothing can go with VB ('CComBaseContainer::GetMultipleAttributes failed' error is raised)
it tried such method Out=Visum.Net.Zones.GetmultipleAttributes(In) with following data types, everytime the same error:
Dim Out As Object Dim In As New List(Of String) Dim In(2) As String In.toArray()How can I satisfy this method?
PS. Quote from documentation:
GetMultipleAttributes ( [in] VARIANT AttrIDs, [out, retval] VARIANT *value) Returns the values of several attributes for all net objects of the container. The attribute ID have to be specified as a vector of BSTR strings. The return value contains a matrix of VARIANT values consisting of the values of all objects and specified attributes. The rows of the matrix correspond to the net objects in standard order (ordered by their keys). The columns correspond to the attributes in the order as specified. Parameters [in] VARIANT AttrIDs Vectorof attribute IDs as in ATTRIBUTE.XLS. [out, retval] VARIANT *value Matrix of values of these attributes for all net objects in the container
Thanks in advance i2
最满意答案
如果这在VBS中有效:
Visum.Net.Zones.GetmultipleAttributes(Array("No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"))这应该在VB.NET中工作:
Dim a() As String= New String() {"No", "Name", "XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"} Visum.Net.Zones.GetmultipleAttributes(a) 'you might need a() instead看看这个问题是为了澄清: VB.NET中Array()的等价物?
The following finally worked, but don't ask me why:
Dim In() As Object = {"No","Name","XCoord","YCoord","Name","SHAREPRTORIG","SHAREPRTDEST"} Dim VisumOut(,) As Object VisumOut = Visum.Net.Zones.GetMultipleAttributes(In)After million of tries it finally went fine. If you know why is that, please give us proper answer.
Powodzenia, Rafał!
发布评论