我在 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