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.
[email protected] 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
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev