【发布时间】:2012-02-27 19:33:48
【问题描述】:
我的 C# 程序通过 Nco3 (sapnco.dll) 访问 SAP。该程序还需要与 Delphi 配合使用。我的一些方法从 sapnco.dll 返回类型:
public void IRfcTable table(...) { ... }
在 Delphi 中,此方法显示为
function table(...): IUnknown { ... }
我想这个IUnknown 是因为我的 TLB 不包含 sapnco.dll。我在 Visual Studio 中尝试了“Embed Interop Types = true”,但随后出现此错误:
错误 Interoptypen aus 程序集“C:\...”不知道是否存在 ImportedFromTypeLibAttribute-Attribut 或 das PrimaryInteropAssemblyAttribute-Attribut fehlt。 c:...\sapnco.dll
(无法嵌入互操作类型,因为缺少某些属性)。
这是正确的方法吗?如果有,这些属性放在哪里?
【问题讨论】: