.net ';IADsLargeInteger';在命名空间中不明确';ActiveDs';
我正在用VB语言编写一个项目,当我试图编译它时,我遇到了这种类型的错误 “'IADsLargeInteger'在命名空间'ActiveDs'中不明确” 这是代码中给出错误的部分:.net ';IADsLargeInteger';在命名空间中不明确';ActiveDs';,.net,vb.net,dll,.net,Vb.net,Dll,我正在用VB语言编写一个项目,当我试图编译它时,我遇到了这种类型的错误 “'IADsLargeInteger'在命名空间'ActiveDs'中不明确” 这是代码中给出错误的部分: Function GetLargeInteger(ByVal val As Int64) As IADsLargeInteger Dim largeInt As New ActiveDs.LargeInteger largeInt.HighPart = CType((val >&
Function GetLargeInteger(ByVal val As Int64) As
IADsLargeInteger
Dim largeInt As New ActiveDs.LargeInteger
largeInt.HighPart = CType((val >> 32), Integer)
val = val << 32
val = val >> 32
largeInt.LowPart = (Convert.ToInt32(val))
Return largeInt
End Function
请提供帮助,因为我不知道哪里出了问题,错误消息告诉您的是,
IADsLargeInteger
在某个地方定义了多次,编译器不知道使用哪一个。您要么删除一个定义(一个的imports语句),要么精确地指向要使用的定义。我假设您要使用的函数包含在ActiveDS
中,给定largeint
声明,因此更改您的函数以返回该函数:
Function GetLargeInteger(ByVal val As Int64) As ActiveDS.IADsLargeInteger
Dim largeInt As New ActiveDs.LargeInteger
largeInt.HighPart = CType((val >> 32), Integer)
val = val << 32
val = val >> 32
largeInt.LowPart = (Convert.ToInt32(val))
Return largeInt
End Function
函数GetLargeInteger(ByVal作为Int64)作为ActiveDS.IADsLargeInteger
Dim largeInt作为新活动。LargeInteger
largeInt.HighPart=CType((val>>32),整数)
val=val>32
largeInt.LowPart=(转换为32(val))
回程大
端函数
文件顶部的导入
指令很重要,我们看不到它们。函数的返回类型声明在代码段中看起来非常不可靠,请将其保留在一行中,然后键入全名,包括ActiveDs。prefix@HansPassant我编辑了我的问题,现在你可以看到我所有的导入
Function GetLargeInteger(ByVal val As Int64) As ActiveDS.IADsLargeInteger
Dim largeInt As New ActiveDs.LargeInteger
largeInt.HighPart = CType((val >> 32), Integer)
val = val << 32
val = val >> 32
largeInt.LowPart = (Convert.ToInt32(val))
Return largeInt
End Function