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

Vitali Pelenjow Vitali.Pelenjow at oracle.com
Tue Mar 1 14:40:12 GMT 2011


Hi,

your code would work only within the VM process.

To get a screenshot from another process, you should use 
TakeScreenShotToArray API.
It uses a safe array instead of a memory buffer to get the bitmap.

Best regards,
Vitali.


donthaveone at Safe-mail.net wrote:
> 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