我在看Virtual Box的例子.我很快尝试触发以下代码,但是我收到了与COM相关的错误.
//#include "VirtualBox.h"
#include "rpc.h"
#include
int main(int argc, char *argv[])
{
HRESULT rc;
// IVirtualBox *virtualBox;
do
{
/* Initialize the COM subsystem. */
CoInitialize(NULL);
/* 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 …