BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Win32 error

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Alexander Aliev
Guest





PostPosted: Tue Apr 18, 2006 7:03 am    Post subject: Win32 error Reply with quote



Hi,

I have the following little problem: when my vcl-application
working and I lock the computer then after unlocking
a message box appears (header - my application):

Win32 Error. Code: 5
Access denied.

What can be the reason?
Thank you for any help.

Alexander
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Apr 18, 2006 10:03 am    Post subject: Re: Win32 error Reply with quote



"Alexander Aliev" <ali (AT) isa (DOT) ru> wrote in message
news:4444845f$1 (AT) newsgroups (DOT) borland.com...

Quote:
Win32 Error. Code: 5
Access denied.

What can be the reason?

Your description is much too vague. You need to provide more details. What
is your application doing? At what point in the code does the error occur?


Gambit
Back to top
Alexander Aliev
Guest





PostPosted: Tue Apr 18, 2006 10:03 am    Post subject: Re: Win32 error Reply with quote



Quote:
... At what point in the code does the error occur?

I have a handler for Application->OnIdle. There is a line in it:

TPoint p = Mouse->CursorPos;

which is highlighted when error and I click my handler in stack
window. Next called functions in stack are not mine. Here is
the upper part of stack window:

\WINDOWS\system32\kernel32.dll
Sysutils::RaiseLastWin32Error
Sysutils::Win32Check
Controls::TMouse::GetCursorPos

What's wrong? Or I can't take cursor position if PC is locked?
What is a way round then?

TIA,
Alexander
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Apr 18, 2006 7:03 pm    Post subject: Re: Win32 error Reply with quote

"Alexander Aliev" <ali (AT) isa (DOT) ru> wrote in message
news:4444b07f (AT) newsgroups (DOT) borland.com...

Quote:
I have a handler for Application->OnIdle. There is a line in it:

TPoint p = Mouse->CursorPos;

which is highlighted when error

You are not allowed to access the desktop while the PC is locked. Your
OnIdle event handler is likely being triggered before the PC is fully
unlocked.

Quote:
Or I can't take cursor position if PC is locked?

Nope.

Quote:
What is a way round then?

Don't use the TMouse::CursorPos property. Call the Win32 API GetCursorPos()
function directly instead. Then you can do your own error checking in your
code and avoid the exception that the CursorPos property is throwing.


Gambit
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.