【发布时间】:2012-11-08 04:51:25
【问题描述】:
我在 idl 文件中定义了一个接口,并尝试将 vb6 项目转换为 vb.net。
转换从这个 idl 的 tlb 创建了互操作,在 vs2010 中它抱怨该属性没有被实现(如下所示)。有谁知道为什么?我什至删除了实现并让 vs2010 重新生成存根,但仍然出错。
idl中的示例接口..
[ uuid(...),
version(2.0),
dual,
nonextensible,
oleautomation
]
interface IExampleInterface : IDispatch
{
...
[id(3), propget]
HRESULT CloseDate ([out, retval] DATE* RetVal);
[id(3), propput]
HRESULT CloseDate ([in] DATE* InVal);
}
VB.Net 类...
<System.Runtime.InteropServices.ProgId("Project1_NET.ClassExample")>
Public Class ClassExample
Implements LibName.IExampleInterface
Public Property CloseDate As Date Implements LibName.IExampleInterface.CloseDate
Get
Return mDate
End Get
Set(value As Date)
mDate = value
End Set
End Property
【问题讨论】:
-
发布代码时,请将其突出显示并点击
{}代码按钮。这让我们将其视为代码并打开语法高亮。 -
你解决了这个问题了吗?如果你这样做了,请与 as 分享并接受你的回答。
标签: vb.net com vb6 vb6-migration idl