【发布时间】:2013-11-03 12:42:26
【问题描述】:
我正在尝试在 Windows 7 上使用 VirtualBox sdk。 为此,我使用 VirtualBoxSDK\bindings\mscom\samples\ 中提供的示例代码作为启动。此示例包含以下代码:
/* Instantiate the VirtualBox root object. */
rc = CoCreateInstance(CLSID_VirtualBox, /* the VirtualBox base object */
NULL, /* no aggregation */
CLSCTX_LOCAL_SERVER, /* the object lives in a server process on this machine */
IID_IVirtualBox, /* IID of the interface */
(void**)&virtualBox);
if (!SUCCEEDED(rc))
{
printf("Error creating VirtualBox instance! rc = 0x%x\n", rc);
break;
}
代码构建正常,链接正常,但是当我运行它时,我得到:创建 VirtualBox 实例时出错! rc = 0x80040154(无法加载文件或程序集错误)。 我假设没有服务器端(可能)会提供我试图用 CoCreateInstance() 创建的 COM 对象。我只是开始提供提供的示例,但我假设应该有一些服务器也在运行?! 提供的文档没有提及有关某些服务器的任何内容,但这就是我的想法。 谢谢
【问题讨论】:
-
不知道,这个问题的原因是什么。我只想告诉你,我对 VirtualBox 的 COM 和 SOAP API 感到很不满意。他们的故障非常严重。考虑使用基于命令行的 VM 控制,因为它是使用最多的一种。
标签: c++ c com virtualbox