[英]Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic
What does this error mean in VB6? 这个错误在VB6中意味着什么?
Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic.
标记为受限制的函数或接口,或者该函数使用Visual Basic中不支持的自动化类型。
I keep getting it when i call a particular method of a dll that comes with windows xp and beyond (in system32 called upnp.dll) 当我调用windows xp及更高版本附带的dll的特定方法时,我一直得到它(在system32中称为upnp.dll)
This is the declaration for FindByType() as retrieved from the type library: 这是从类型库中检索的FindByType()声明:
HRESULT FindByType(
[in] BSTR bstrTypeURI,
[in] unsigned long dwFlags,
[out, retval] IUPnPDevices** pDevices);
Note the 2nd argument, unsigned long. 注意第二个参数,unsigned long。 VB6 doesn't support unsigned types.
VB6不支持无符号类型。 It is not a problem in VB.NET or C#, they do support them.
它不是VB.NET或C#中的问题,它们确实支持它们。
This problem is fixable if you have the Windows SDK installed. 如果您安装了Windows SDK,则此问题可以修复。 You should have it if you have a recent version of Visual Studio.
如果您有最新版本的Visual Studio,则应该拥有它。 Use the Visual Studio Command Prompt, then:
使用Visual Studio命令提示符,然后:
You can now add upnp.tlb instead of upnp.dll, you should no longer get the error. 您现在可以添加upnp.tlb而不是upnp.dll,您应该不再收到错误。 -
-
Well, the error message means that you're calling a function that can't be bound by VB6, possibly due to it have parameters or a return value of a data type that VB6 doesn't support. 好吧,错误消息意味着您正在调用一个不能被VB6绑定的函数,可能是因为它有参数或VB6不支持的数据类型的返回值。 I sometimes worked around issues like this by writing a simple C++ COM object that called the function and "translated" it to be VB6 compatible.
我有时通过编写一个调用该函数的简单C ++ COM对象并将其“翻译”为VB6兼容来解决这类问题。
You can sometimes also get this error message due to various typos, but I think you've already discovered that with your search on google so I'm assuming you've already checked for that. 由于各种拼写错误,您有时也会收到此错误消息,但我认为您已经发现在谷歌上进行搜索,所以我假设您已经检查过了。
If you post your code (or at least the name of the function that you're having problems with) it's possible that you could get a better answer. 如果您发布代码(或至少是您遇到问题的函数的名称),您可能会得到更好的答案。
I got the same error but when I changed my array name the error went away. 我得到了同样的错误但是当我更改了我的数组名称时,错误就消失了。
"Map" apparently isn't an acceptable array name. “Map”显然不是一个可接受的数组名称。
error code: map(day, min) = Trim(Str(Int(r / 1000)))
错误代码:
map(day, min) = Trim(Str(Int(r / 1000)))
no error code: mapsymbol(day, min) = Trim(Str(Int(r / 1000))
) 没有错误代码:
mapsymbol(day, min) = Trim(Str(Int(r / 1000))
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.