[vbox-dev] Issues about the function CreateBaseStorage()

wei ma wei.ma1222 at gmail.com
Wed Jan 27 12:32:03 PST 2010


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100128/6e2f929b/attachment-0001.html 


More information about the vbox-dev mailing list