Board index » delphi » Couple of questions - please help!

Couple of questions - please help!

Hi folks,

I have a couple of annoying problems with a Delphi project that are
holding up its release:

1.  The application makes use of a popup menu, which is regularly updated
using PopupMenu.Add (MenuItem).  This is fine, except when the user is
viewing the menu, as it causes the menu to stop responding to mouse
events.  So ideally I need some way of detecting when the popup's
displayed so that I can avoid adding items at this time.  GetCapture
seemed to do the trick, only I can't seem to get the popup's handle to
compare it with.  

2.  Whenever I call Reset() on an untyped file, I get an Access Denied
message, independant of the FileMode.

If anyone could please help me with these problems, I'd be incredibly
grateful, as they're really bugging me!

Cheers,

Philip.
=======

Please post and email replies, to: pt...@hermes.cam.ac.uk

 

Re:Couple of questions - please help!


Quote
Philip Plant wrote:

1. using PopupMenu.Add (MenuItem).  This is fine, except when the user
is

Quote
> viewing the menu, as it causes the menu to stop responding to mouse
> events.  So ideally I need some way of detecting when the popup's
> displayed

=====>> you could try  setting/resettong  a flag in the OnPopUp event,
indicating  the user is busy ??

Quote
> 2.  Whenever I call Reset() on an untyped file, I get an Access Denied
> message, independant of the FileMode.

====>>  Assuming that FILEMODE := 2 ( read/write) : when the OS says you
can't access a file , there are just 2 possible reasons:
- the file is already open ; either by another application, or your own
( happens to me all the time..)
assuming a network:
- the file is in use by another user,
- the file is in a dir that you haven't access to.

happy hunt!
Dirk Claessens

Other Threads