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

donthaveone at Safe-mail.net donthaveone at Safe-mail.net
Tue Mar 1 14:15:54 GMT 2011

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);

                                                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 :(

More information about the vbox-dev mailing list