我需要将 int 或 long 数组(无关紧要)从 VB6 应用程序传递到 C# COM Visible 类。我尝试在 C# 中声明接口,如下所示:
void Subscribe([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_I4)]int[] notificationTypes)
void Subscribe(int[] notificationTypes)
但两人都提出了Function or interface markes as restricted, or the function uses an Automation type not supported in Visual Basic
.
我应该如何声明 C# 方法?
如果您感到绝望,请在虚拟 VB6 ActiveX dll 项目中编写签名。然后通过 Visual Studio 或命令行工具生成 .NET Interop 版本的 vb6 组件。然后使用 Reflector 或 dotPeek 将代码从互操作程序集中拉出。虽然路途遥远,但很有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)