iamhatling
2014-06-12 09:22:33 UTC
sorry for my bad english
i want to write a vbox frontend,
but i met a problem at the beginning,
when i call "ISession->get_Console " to get the console interface ,it return null,
the following is my code
+++++++++++++++++++++++++++++++++++++++++++++++++
IVirtualBox *virtualBox;
IVirtualBoxClient* virtualBoxClient;
CoInitialize(NULL);
CoCreateInstance(
CLSID_VirtualBoxClient,
NULL,
CLSCTX_INPROC_SERVER,
IID_IVirtualBoxClient,
(void**)&virtualBoxClient
);
ISession* session;
virtualBoxClient->get_Session(&session);
virtualBoxClient->get_VirtualBox(&virtualBox);
IMachine* machineTemp;
BSTR machineName = SysAllocString(L"xp");
virtualBox->FindMachine(machineName,&machineTemp);
SysFreeString(machineName);
machineTemp->LockMachine(session,LockType_VM);
IMachine* machine;
session->get_Machine(&machine);
IConsole* console;
session->get_Console(&console);////////////console=null here
+++++++++++++++++++++++++++++++++++++++
iamhatling
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20140612/355983a5/attachment.html
i want to write a vbox frontend,
but i met a problem at the beginning,
when i call "ISession->get_Console " to get the console interface ,it return null,
the following is my code
+++++++++++++++++++++++++++++++++++++++++++++++++
IVirtualBox *virtualBox;
IVirtualBoxClient* virtualBoxClient;
CoInitialize(NULL);
CoCreateInstance(
CLSID_VirtualBoxClient,
NULL,
CLSCTX_INPROC_SERVER,
IID_IVirtualBoxClient,
(void**)&virtualBoxClient
);
ISession* session;
virtualBoxClient->get_Session(&session);
virtualBoxClient->get_VirtualBox(&virtualBox);
IMachine* machineTemp;
BSTR machineName = SysAllocString(L"xp");
virtualBox->FindMachine(machineName,&machineTemp);
SysFreeString(machineName);
machineTemp->LockMachine(session,LockType_VM);
IMachine* machine;
session->get_Machine(&machine);
IConsole* console;
session->get_Console(&console);////////////console=null here
+++++++++++++++++++++++++++++++++++++++
iamhatling
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20140612/355983a5/attachment.html