等同于List T的VBA.在C#中 [英] VBA Equivalent to List<T> in C#

查看:88
本文介绍了等同于List T的VBA.在C#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
等同于列表的VB6< T>

Possible Duplicate:
VB6 equivalent to a List<T>

重复项:

访问与List<T>

我以前用错误的信息发布了这个问题,所以我将其重新发布,以期获得正确的答案.我有一个用C#编写的COM可见对象,该对象接受字符串数组的列表.我可以从Access 2000向此对象发送一个字符串数组集合,它可以工作吗?如果不是,那么从Access 2000向我的C#对象发送多个字符串数组的最佳方法是什么?

I posted this question with the wrong information before, so I am reposting it in the hopes of getting a correct answer. I have a COM-visible object written in C# that accepts a list of string arrays. Could I send a Collection of string arrays from Access 2000 to this object and it work? If not, then what is the best way to send multiple string arrays to my C# object from Access 2000?

推荐答案

首先,COM没有泛型的概念;因此您不会有任何用List<string[]>制作东西的运气.

Firstly, COM has no concept of generics; so you won't have any luck trying to make something out of a List<string[]>.

为什么不只是将重载添加到C#方法中以接受string[][](锯齿状的字符串数组)?除非我弄错了,否则应该可以从VBA上做到这一点.

Why don't you just add an overload to your C# method to accept a string[][] (a jagged array of strings)? That should be doable from VBA, unless I'm mistaken.

如果这个答案不合时宜,我深表歉意;我没有在这台机器上安装MS Office,并且基本上是根据我对VBA和COM互操作的有限了解来回答.但是我认为锯齿状的阵列建议可能至少会在正确的方向上推动您.

I apologize if this answer is way off the mark; I don't have MS Office installed on this machine and am basically answering based on my limited knowledge of VBA and COM interop. But I thought the jagged array suggestion might at least nudge you in the right direction.

这篇关于等同于List T的VBA.在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆