i am trying to code with VirtualBox C API,but now i think i just had some
problems.
when i am trying to creae a new virtual machine,i think it's necessary to
create a hard disk for the first thing.
but when i try to create that hard disk with the funtions such as
CreateHardDisk() and CreateBaseStorage(),it seem never gonna work.the
function CreateBaseStorage() always failed,but i can't find out the reason.
My code looks like this:
[code]
rc=vbox->vtbl->CreateMachine(vbox,name16,osTypename,NULL,NULL,&machine);
if(NS_FAILED(rc))
{
   printf("CreateMachine Failed.\n");
   return;
}
IHardDisk *hdisk=0;
IProgress *progress;
rc=vbox->vtbl->CreateHardDisk(vbox,format16,location16,&hdisk);
if(NS_FAILED(rc) || hdisk==0)
{
   printf("CreateHardDisk Failed.\n");
   return;
}
enum HardDiskVariant hdVariant;
hdVariant |= HardDiskVariant_Standard;
rc=hdisk->vtbl->CreateBaseStorage(hdisk,1000,hdVariant,&progress);
if(NS_FAILED(rc))
{
   printf("CreateBaseStorage Failed.\n");
   return;
}[/code]


error always happens when i call CreateBaseStorage(),the resulecode might be
"rc=80004003"

so can anybody help me?thanks a lot.
this issue has bothered me for couple of days.
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev

Reply via email to