i am trying to code with VirtualBox C API,but now i think i just had some problems.<br>when i am trying to creae a new virtual machine,i think it's necessary to create a hard disk for the first thing.<br>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.<br>My code looks like this:<br>[code]<br><dl><dd><code>rc=vbox->vtbl->CreateMachine(vbox,name16,osTypename,NULL,NULL,&machine);<br>if(NS_FAILED(rc))<br>{<br>   printf("CreateMachine Failed.\n");<br>


   return;<br>}<br>IHardDisk *hdisk=0;<br>IProgress *progress;<br>rc=vbox->vtbl->CreateHardDisk(vbox,format16,location16,&hdisk);<br>if(NS_FAILED(rc) || hdisk==0)<br>{<br>   printf("CreateHardDisk Failed.\n");<br>


   return;<br>}<br>enum HardDiskVariant hdVariant;<br>hdVariant |= HardDiskVariant_Standard;<br>rc=hdisk->vtbl->CreateBaseStorage(hdisk,1000,hdVariant,&progress);<br>if(NS_FAILED(rc))<br>{<br>   printf("CreateBaseStorage Failed.\n");<br>


   return;<br>}</code></dd></dl>[/code]<br><br><br>error always happens when i call CreateBaseStorage(),the resulecode might be "rc=80004003"<br><br>so can anybody help me?thanks a lot.<br>this issue has bothered me for couple of days.