在哪里可以找到 VARIANT 类型代码? (vboxapi问题)
我通过 COM 使用 vboxapi
,我注意到一个错误...调用 IMedium.CreateBaseStorage
因为他们定义了它会产生错误,“无效的 VARIANT 类型:20 ”。我将 20 的值更改为 19,这是另一个(整数)参数的变体:
def _patch_createBaseStorage(self, aLogicalSize, aVariant):
from win32com.client import Dispatch
LCID = 0x0
ret = self._oleobj_.InvokeTypes(1610743844, LCID, 1, (9, 0),
((19, 1), #used to be: (20, 1),
(19, 1)),aLogicalSize
, aVariant)
if ret is not None:
ret = Dispatch(ret, u'CreateBaseStorage', '{A163C98F-8635-4AA8-B770-A9941737F3EF}', UnicodeToString=0)
return ret
但是,这不起作用,因为该值是硬盘驱动器的大小(以字节为单位),这意味着它最多可以为 4 GB ,而我需要制作80、120、250 GB的硬盘等。
那么8字节整数的VARIANT类型是什么?我假设它是 VT_I8
,但是数值是多少?为了将来参考,我在哪里可以找到它们?
如果该值是 20 那么我就完蛋了,因为这是失败的值......在这种情况下,其他人有建议吗?
I'm using vboxapi
through the COM, and I noticed a bug... calling IMedium.CreateBaseStorage
as they have defined it yields an error, "Invalid VARIANT type: 20". I changed the value of 20 to 19, which was the VARIANT of the other (integer) parameter:
def _patch_createBaseStorage(self, aLogicalSize, aVariant):
from win32com.client import Dispatch
LCID = 0x0
ret = self._oleobj_.InvokeTypes(1610743844, LCID, 1, (9, 0),
((19, 1), #used to be: (20, 1),
(19, 1)),aLogicalSize
, aVariant)
if ret is not None:
ret = Dispatch(ret, u'CreateBaseStorage', '{A163C98F-8635-4AA8-B770-A9941737F3EF}', UnicodeToString=0)
return ret
however, this doesn't work, as the value is the size of the hard drive in bytes, meaning it can be at most 4 gigabytes, while I need to make 80, 120, 250 GB hard drives, etc.
So what's the VARIANT type of an 8-byte integer? I assume it is VT_I8
, but what is the numerical value? And for future reference, where can I find them?
If the value is 20 then i'm screwed, since that is the value that is failing... in that case, anyone else have advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里是一个来源(底部的表格)。
Here is one source (table at the bottom).