Re: Is there any way to take screen capture in .dll?
Hi,
a .dll, which is not started in an application?? How a dll can be executed without loading!!!
Probably you are trying a wrong apporach(thought). for your purpose, you can write one exe program, which can listen to the key events (or any other mechanism), and once that criteria is fulfilled, it can take the screen shot of your phone.
Re: Is there any way to take screen capture in .dll?
.dll is started by other .dll.
Which is started by...? Your dll's have to be loaded by an exe or by an app (pre v9). Which one is it? If the exe is a console app or a server, then you need to manually connect to the window server and create the necessary resources for taking the screen capture. If your exe is a GUI application, then just use the screen device class to take the screen capture.
Re: Is there any way to take screen capture in .dll?
I assumed he meant the dll is loaded by an exe that doesn't start the application framework, and therefore doesn't have CCoeEnv.
Anyhow, to the original poster:
WSERV 7 means "Invalid bitmap handle" and the reason is you forget to create your bitmap fully.
Its not enough to just call "new" you have to call Create also.
Forum posts: 1155
Yes.
I assume you ask because you before have used the CWsScreenDevice from CCoeEnv::Static()->ScreenDevice().
You can also create your own CWsScreenDevice.
First you have to create a RWsSession and connect it to the window server though
(Untested code, just wrote it down from memory:)
RWsSession ws; if(KErrNone == ws.Connect()) { CWsScreenDevice* scrdev = new (ELeave) CWsScreenDevice(ws); CleanupStack::PushL(scrdev); ///[...] scrdev->CopyScreenToBitmap(... ); /// [...] CleanupStack::PopAndDestroy(); ws.Close(); }or something along those lines....
Forum posts: 4
I have tried that already. Code looked like this:
RWsSession iWs;
CWsScreenDevice* iScreen;
User::LeaveIfError(iWs.Connect());
iScreen=new (ELeave) CWsScreenDevice(iWs);
User::LeaveIfError(iScreen->Construct());
CFbsBitmap* iBmp = new (ELeave) CFbsBitmap;
CleanupStack::PushL( iBmp );
TInt err=iScreen->CopyScreenToBitmap( iBmp ); //Causes panic WSERV 7
User::LeaveIfError(err);
CleanupStack::PopAndDestroy( iBmp )
And it causes panic WSERV 7.
Forum posts: 120
Hi,
a .dll, which is not started in an application?? How a dll can be executed without loading!!!
Probably you are trying a wrong apporach(thought). for your purpose, you can write one exe program, which can listen to the key events (or any other mechanism), and once that criteria is fulfilled, it can take the screen shot of your phone.
Regards,
Jupitar
Jupitar
Forum posts: 4
.dll is started by other .dll.
Forum posts: 608
Which is started by...? Your dll's have to be loaded by an exe or by an app (pre v9). Which one is it? If the exe is a console app or a server, then you need to manually connect to the window server and create the necessary resources for taking the screen capture. If your exe is a GUI application, then just use the screen device class to take the screen capture.
Forum posts: 1155
I assumed he meant the dll is loaded by an exe that doesn't start the application framework, and therefore doesn't have CCoeEnv.
Anyhow, to the original poster:
WSERV 7 means "Invalid bitmap handle" and the reason is you forget to create your bitmap fully.
Its not enough to just call "new" you have to call Create also.