[vbox-dev] IDisplay::TakeScreenShot returns NS_ERROR_UNEXPECTED (0x8000ffff)

Nikolay Igotti nikolay.igotti at oracle.com
Wed Mar 2 07:38:17 GMT 2011


Hi,

You can use approach VItaly suggested, and also you may try Python or 
Java bindings to access this API.
Coding with it (especially Python) is generally simpler - see function 
takeScreenshot() in vboxshell.py
(http://www.virtualbox.org/svn/vbox/trunk/src/VBox/Frontends/VBoxShell/vboxshell.py)

Hope that'll help,
Nikolay

01.03.2011 17:15, donthaveone at Safe-mail.net пишет:
> Hi Guys!
>
> First of all, this is the first time I'm using a Mailing List, so I hope I don't do anything wrong!
>
> My Problem is that I want to get a screenshot from a running VirtualBox using C++ COM Interface on Linux.
>
> Here is the code I'm trying to use:
>
>                                                  #define CERR(x) if(NS_FAILED(rc)) printErrorInfo(x);
>
>                                                  PRUint32 width = 0, height = 0, bpp = 0;
>                                                  int buffersize;
>                                                  BYTE* databuff;
>
>                                                  rc = display->GetScreenResolution(0,&width,&height,&bpp);
>                                                  CERR("GetScreenResolution")
>
>                                                  buffersize = width*height*4;
>                                                  databuff = (BYTE*) new char [buffersize];
>
>                                                  if (databuff != NULL)
>                                                  {
>                                                          rc = display->TakeScreenShot(0,databuff,width,height);
>                                                          cout<<  "rc = "<<  hex<<  rc<<  endl;
>
>                                                  }
>
> But TakeScreenShot() returns NS_ERROR_UNEXPECTED :\
> I'm using the actual OSE Release. First I built VirtualBox and then I linked my Code with the built libraries.
>
> Then I started the VirtualBox Frontend, booted the VM and then I tried to get the screenshot using the code above.. But it doesn't work :\
>
> Is there any other SDK  API I could use?
>
> Thanks in advance.
>
>
> PS: I used google but did not find anythin which helped me to solve my problem :(
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev





More information about the vbox-dev mailing list