CMutex::Lock is re-entrant?

I was able to call CMutex::Lock from the same thread twice w/o calling 
CMutex::Unlock in between. I interpret this as it being re-entrant, is this 
correct?

I assume that if another thread (B) calls CMutex::Lock after thread A has 
called it, thread B will wait for thread A to call CMutex::Unlock. But i 
haven't verified this, and i'm not sure how it accomplishes this because all 
it does behind the scene is calling 

	if (::WaitForSingleObject(m_hObject, dwTimeout) == WAIT_OBJECT_0)
in Lock(). I'm not sure i'm convinced that thread B would block, if thread A 
itself didn't block calling this a second time. Since WaitForSingleObject 
returned immediately for thread A, it means object is signaled, and if that's 
the only check made, then thread B will return immediately too.

Unless somebody convinces me that thread B would actually block, i'm 
thinking about making a test app for this to be sure. Even though from the 
name of the class, i really assumed it was the same as Unix-style mutexes.

Thanks.
0
ultranet (61)
9/10/2005 3:46:05 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
1096 Views

Similar Articles

[PageSpeed] 44

"ultranet" wrote:

> I was able to call CMutex::Lock from the same thread twice w/o calling 
> CMutex::Unlock in between. I interpret this as it being re-entrant, is this 
> correct?
> 
> I assume that if another thread (B) calls CMutex::Lock after thread A has 
> called it, thread B will wait for thread A to call CMutex::Unlock. But i 
> haven't verified this, and i'm not sure how it accomplishes this because all 
> it does behind the scene is calling 
> 
> 	if (::WaitForSingleObject(m_hObject, dwTimeout) == WAIT_OBJECT_0)
> in Lock(). I'm not sure i'm convinced that thread B would block, if thread A 
> itself didn't block calling this a second time. Since WaitForSingleObject 
> returned immediately for thread A, it means object is signaled, and if that's 
> the only check made, then thread B will return immediately too.
> 
> Unless somebody convinces me that thread B would actually block, i'm 
> thinking about making a test app for this to be sure. Even though from the 
> name of the class, i really assumed it was the same as Unix-style mutexes.
> 
> Thanks.
I guess one way this could work is if the lock object was treated as 
signalled for the thread that owns it, and non-signalled for alll other 
threads. Not being able to step into that source, kinda makes me raise this 
question though...
0
ultranet (61)
9/10/2005 3:51:06 AM
There have been any number of misimplementations of synchronization in the CWhatever
classes (for example, I once discovered an incredibly stupid bug in the implementation of
CEvent...the SetEvent would not actually set the event if it thought it had already set
the event, which worked fine in the childish programs the implementor had tested but would
not work if the event was set by application A and reset by application B; application A
thought it was already set and the MFC code refused to call the underlying ::SetEvent!
Reasons like this are why I would NEVER trust these synchronization objects in a real
program).

A mutex has what are called "recursive acquisition" semantics.  Mutice are "owned" by a
thread, and if that thread attempts to re-acquire them, it is able to pass without
blocking.  However, you must also call ::ReleaseMutex as many times as you have done a
::WaitFor... or it remains owned.  Only the thread that owns a mutex can unlock it.

A common mistake in coding ::WaitForSingleObject is the error you show below.  Code like
this is always wrong.  ::WaitForSingleObject can return, in the case of a mutex, FOUR
different values, and why you would test for only one of them makes no sense.  The four
cases are: (1) WAIT_OBJECT_0: the mutex has been acquired (2) WAIT_TIMEOUT if the timeout
ocurred (3) WAIT_ERROR if the mutex handle is erroneous, and (4) WAIT_ABANDONED if the
mutex is abandoned.  If you do not explicitly check for EVERY ONE OF THESE CONDITIONS your
code is erroneous and cannot be trusted (one special case: if you are doing INFINITE for
the wait, you can omit the WAIT_TIMEOUT test).  The ONLY correct way to write code like
this is

switch(::WaitForSingleObject(object, timeout))
    { /* wait */
      case WAIT_OBJECT_0:
             break;
      case WAIT_TIMEOUT:
            ... deal with timeout
      case WAIT_ERROR:
            ASSERT(FALSE);
            ... deal with illegal handle problems
      case WAIT_ABANDONED:
           ... you are now in such deep trouble that you can spend weeks writing this code
   } /* wait */

The fact that the code in MFC is NOT what you claimed, but is even worse:

BOOL CSyncObject::Lock(DWORD dwTimeout)
{
	DWORD dwRet = ::WaitForSingleObject(m_hObject, dwTimeout);
	if (dwRet == WAIT_OBJECT_0 || dwRet == WAIT_ABANDONED)
		return TRUE;
	else
		return FALSE;
}

proves that beyond any shadow of a doubt this implementation CANNOT be trusted!  It
actually claims that WAIT_ABANDONED means "lock has been acquired"! This goes so far
beyond stupidity and incompetence that it can only be classified as criminally
irresponsible.

(By the way, your interpretation of what happens in the simple case is incorrect; you
think that because a thread which owns the mutex would return immediately, that a thread
which doesn't own the mutex would return immediately.  This is because you have confused
signaled/nonsignaled with mutex ownership.  A mutex becomes nonsignaled, but it is also
owned, and that's the key difference; thread B would block, at least for its timeout
period, or until the mutex becomes abandoned; thread A doesn't care about the nonsignaled
state because it is already the owner).

An abandoned mutex is a catastrophe.  Not just a little glitch; a major catastrophe.  It
always represents a seriously erroneous program, but in the presence of such an error, you
must still recover properly.  This is nontrivial (having written code that can recover
from abandoned mutice, I can state this with some confidence.  We had to deal with shared
data in the presence of clients of unknown reliability).  Consequently, the simplest
approach is to handle abandoned mutex as invalidating all computations currently in
progress, and nothing that is protected by the mutex can be assumed to be intact any
longer, and will literally have to be abandoned.  And this, too, is nontrivial.  
					joe

On Fri, 9 Sep 2005 20:46:05 -0700, "ultranet" <ultranet@discussions.microsoft.com> wrote:

>I was able to call CMutex::Lock from the same thread twice w/o calling 
>CMutex::Unlock in between. I interpret this as it being re-entrant, is this 
>correct?
>
>I assume that if another thread (B) calls CMutex::Lock after thread A has 
>called it, thread B will wait for thread A to call CMutex::Unlock. But i 
>haven't verified this, and i'm not sure how it accomplishes this because all 
>it does behind the scene is calling 
>
>	if (::WaitForSingleObject(m_hObject, dwTimeout) == WAIT_OBJECT_0)
>in Lock(). I'm not sure i'm convinced that thread B would block, if thread A 
>itself didn't block calling this a second time. Since WaitForSingleObject 
>returned immediately for thread A, it means object is signaled, and if that's 
>the only check made, then thread B will return immediately too.
>
>Unless somebody convinces me that thread B would actually block, i'm 
>thinking about making a test app for this to be sure. Even though from the 
>name of the class, i really assumed it was the same as Unix-style mutexes.
>
>Thanks.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
9/11/2005 4:36:01 AM
"Joseph M. Newcomer" wrote:

> The fact that the code in MFC is NOT what you claimed, but is even worse:
> 
> BOOL CSyncObject::Lock(DWORD dwTimeout)
> {
> 	DWORD dwRet = ::WaitForSingleObject(m_hObject, dwTimeout);
> 	if (dwRet == WAIT_OBJECT_0 || dwRet == WAIT_ABANDONED)
> 		return TRUE;
> 	else
> 		return FALSE;
> }
> 
> proves that beyond any shadow of a doubt this implementation CANNOT be trusted!  It
> actually claims that WAIT_ABANDONED means "lock has been acquired"! This goes so far
> beyond stupidity and incompetence that it can only be classified as criminally
> irresponsible.
> 
> (By the way, your interpretation of what happens in the simple case is incorrect; you
> think that because a thread which owns the mutex would return immediately, that a thread
> which doesn't own the mutex would return immediately.  This is because you have confused
> signaled/nonsignaled with mutex ownership.  A mutex becomes nonsignaled, but it is also
> owned, and that's the key difference; thread B would block, at least for its timeout
> period, or until the mutex becomes abandoned; thread A doesn't care about the nonsignaled
> state because it is already the owner).
> 
> An abandoned mutex is a catastrophe.  Not just a little glitch; a major catastrophe.  It
> always represents a seriously erroneous program, but in the presence of such an error, you
> must still recover properly.  This is nontrivial (having written code that can recover
> from abandoned mutice, I can state this with some confidence.  We had to deal with shared
> data in the presence of clients of unknown reliability).  Consequently, the simplest
> approach is to handle abandoned mutex as invalidating all computations currently in
> progress, and nothing that is protected by the mutex can be assumed to be intact any
> longer, and will literally have to be abandoned.  And this, too, is nontrivial.  
> 					joe
So basically, you are saying that thread B would in fact block after thread 
A locks the mutex, but in general CSomething synchronization objects aren't 
reliable. Given our time frame, i'll take your word, and not try to verify 
this.

Btw., in VC 6, i referenced the code correctly:
BOOL CSyncObject::Lock(DWORD dwTimeout)
{
	if (::WaitForSingleObject(m_hObject, dwTimeout) == WAIT_OBJECT_0)
		return TRUE;
	else
		return FALSE;
}

Apparently in VC version you are using, they screwed it up a little.

Finally, i guess the synchronization object has owning thread along w/ 
signaled/non-signalled state, which as you said makes non-owning threads 
block. That makes sense, but i wasn't sure that was the case, so wanted to 
get some feedback.

Thanks.
0
ultranet (61)
9/12/2005 10:06:03 PM
See below...
On Mon, 12 Sep 2005 15:06:03 -0700, "ultranet" <ultranet@discussions.microsoft.com> wrote:

>"Joseph M. Newcomer" wrote:
>
>> The fact that the code in MFC is NOT what you claimed, but is even worse:
>> 
>> BOOL CSyncObject::Lock(DWORD dwTimeout)
>> {
>> 	DWORD dwRet = ::WaitForSingleObject(m_hObject, dwTimeout);
>> 	if (dwRet == WAIT_OBJECT_0 || dwRet == WAIT_ABANDONED)
>> 		return TRUE;
>> 	else
>> 		return FALSE;
>> }
>> 
>> proves that beyond any shadow of a doubt this implementation CANNOT be trusted!  It
>> actually claims that WAIT_ABANDONED means "lock has been acquired"! This goes so far
>> beyond stupidity and incompetence that it can only be classified as criminally
>> irresponsible.
>> 
>> (By the way, your interpretation of what happens in the simple case is incorrect; you
>> think that because a thread which owns the mutex would return immediately, that a thread
>> which doesn't own the mutex would return immediately.  This is because you have confused
>> signaled/nonsignaled with mutex ownership.  A mutex becomes nonsignaled, but it is also
>> owned, and that's the key difference; thread B would block, at least for its timeout
>> period, or until the mutex becomes abandoned; thread A doesn't care about the nonsignaled
>> state because it is already the owner).
>> 
>> An abandoned mutex is a catastrophe.  Not just a little glitch; a major catastrophe.  It
>> always represents a seriously erroneous program, but in the presence of such an error, you
>> must still recover properly.  This is nontrivial (having written code that can recover
>> from abandoned mutice, I can state this with some confidence.  We had to deal with shared
>> data in the presence of clients of unknown reliability).  Consequently, the simplest
>> approach is to handle abandoned mutex as invalidating all computations currently in
>> progress, and nothing that is protected by the mutex can be assumed to be intact any
>> longer, and will literally have to be abandoned.  And this, too, is nontrivial.  
>> 					joe
>So basically, you are saying that thread B would in fact block after thread 
>A locks the mutex, 
***
Yes, the synchronization you expect *between* threads works, because the recursive
acquisition semantics are a different thing that is happening
****
>but in general CSomething synchronization objects aren't 
>reliable. Given our time frame, i'll take your word, and not try to verify 
>this.
***
Actually, the verification is easy; the code from VS.NET proves beyond any shadow of a
doubt that they cannot be trusted.  This actually returns "true", meaning "you have
acquired the lock successfully", when the error is "mutex abandoned", a fatal error.

The example below also demonstrates that they code is unreliable, because you can't tell
the difference bertween a timeout (meaning you might go back and retry the wait after,
say, checking for a thread shutdown event that was set) and anything else.  Note that this
returns TRUE if there IS a timeout, and FALSE on either successful acquisition or
abandonment; or, if you made a transcription error and that should have been !=, then it
returns FALSE on timeout and TRUE on either acquisition or abandonment.  Or on having an
illegal handle.  In any case, only one of four possible cases is covered correctly, and
that means you cannot write reliable code above it.

Example: assume that you get mutex abandoned.  This means "there is the possibility that
the data on which I was working is now in an inconsistent state relative to the
postconditions of mutex release", or rephrased simply, "my data is screwed".  The next
attempt to acquire the mutex may then successfully pass the mutex, and work with invalid
data.  This is generally considered to be in poor taste, and will either generate access
faults if you are lucky, or just silently propagate the error if you are not.
****
>
>Btw., in VC 6, i referenced the code correctly:
>BOOL CSyncObject::Lock(DWORD dwTimeout)
>{
>	if (::WaitForSingleObject(m_hObject, dwTimeout) == WAIT_OBJECT_0)
>		return TRUE;
>	else
>		return FALSE;
>}
>
>Apparently in VC version you are using, they screwed it up a little.
>
>Finally, i guess the synchronization object has owning thread along w/ 
>signaled/non-signalled state, which as you said makes non-owning threads 
>block. That makes sense, but i wasn't sure that was the case, so wanted to 
>get some feedback.
****
The real problem is that the C++ advantages of having the lock/release scoped by a
declaration are lost because they got this all wrong.  For example, CSingleLock should
throw an exception if it can't acquire the lock, e.g.,

swtich(::WaitForSingleObject(...))
   {
     case WAIT_ERROR:
            throw new CWaitException(...);  // CWaitException: public CSyncException
     case WAIT_ABANDONED:
           throw new CAbandonedException(...); // CAbandonedException : public
CSyncException
     case WAIT_TIMEOUT:
          return FALSE;
     case WAIT_OBJECT_0:
          return TRUE;
     default:
          ASSERT(FALSE); // error, unknown return from ::WaitForSingleObject
          throw CSomeWeirdSyncProblem(...);
    }

Now that's what I'd expect in a well-designed class. Lacking something like this makes the
value of the class quesiotnable.  By the way, I looked at the use of m_bAcquired as their
way of telling if the lock was acquired. m_bAcquired will be TRUE if the mutex was
abandoned.  I do not wish to have my life depend on the code  that uses these classes.
*****
>
>Thanks.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
9/14/2005 5:52:07 PM
On Wed, 14 Sep 2005 13:52:07 -0400, Joseph M. Newcomer
<newcomer@flounder.com> wrote:

>The real problem is that the C++ advantages of having the lock/release scoped by a
>declaration are lost because they got this all wrong.

One of my favorite bits of wrongness is the choice of default value:

	explicit CSingleLock(CSyncObject* pObject, BOOL bInitialLock = FALSE);

Probably best not to contemplate how many race conditions this has failed
to avoid...

>For example, CSingleLock should
>throw an exception if it can't acquire the lock, e.g.,
>
>swtich(::WaitForSingleObject(...))
>   {
>     case WAIT_ERROR:
>            throw new CWaitException(...);  // CWaitException: public CSyncException
>     case WAIT_ABANDONED:
>           throw new CAbandonedException(...); // CAbandonedException : public
>CSyncException
>     case WAIT_TIMEOUT:
>          return FALSE;
>     case WAIT_OBJECT_0:
>          return TRUE;
>     default:
>          ASSERT(FALSE); // error, unknown return from ::WaitForSingleObject
>          throw CSomeWeirdSyncProblem(...);
>    }
>
>Now that's what I'd expect in a well-designed class. Lacking something like this makes the
>value of the class quesiotnable.  By the way, I looked at the use of m_bAcquired as their
>way of telling if the lock was acquired. m_bAcquired will be TRUE if the mutex was
>abandoned.  I do not wish to have my life depend on the code  that uses these classes.

That's all very true for kernel mutexes. Note the more commonly used
CRITICAL_SECTION is also subject to this problem, and the documentation
says this:

EnterCriticalSection
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/entercriticalsection.asp
<q>
If a thread terminates while it has ownership of a critical section, the
state of the critical section is undefined.
</q>

Under Windows XP, at least, waiting threads appear to hang, which I suppose
is good, since there's no way to detect the problem and deal with it. Also,
it's mainly crashed threads that abandon, and a crashed thread should take
the whole process with it, which further mitigates the issue.

-- 
Doug Harrison
VC++ MVP
0
dsh (2498)
9/14/2005 7:08:09 PM
Reply:

Similar Artilces:

Re: Date Values
Thanks Bob Your function works a treat, even with Sundays. ...

RE: Error C2664
Hi, I am having soem problem with using the CFileDialog in VC++ 2005 (mfc 8.0). The following works in VC++ 6.0 and VC++ 2003 (VS2003). All the text is on one long line, just had to make it multiline to post here: CFileDialog dlgOpenDatabaseFile(TRUE,".dbf","",OFN_HIDEREADONLY,"All files(*.dbf,*.mdb,*.xls)|*.dbf;*.mdb;*.xls|dBase files(*.dbf)|*.dbf|Access files(*.mdb)|*.mdb|Excel files(*.xls)|*.xls||\0"); Now when I use the above in VC++ 2005, I get the error below when I compile my application. Error 1 error C2664: 'CFileDialog::CFileDialog(BOOL,LPCT...

Excel ALWAYS locks up-little white cross-& I need to reboot HELP!
I have been having lots of trouble with my Excel "locking" up on me. It is so bad that I basically can't use the software. I click into my worksheet and a little white cross appears. Then it appears to "stick" and I need to go into my Task Manager to exit. HELP! Hi, Bunky Girl. Try the following: http://www.officearticles.com/excel/troubleshooting_microsoft_excel.htm ******************* ~Anne Troy www.OfficeArticles.com "Bunky Girl" <Bunky Girl@discussions.microsoft.com> wrote in message news:24BF52E0-94BD-4578-AB07-16FB62AF0EE1@microsoft.com...

re: problem with combo box
I would like to make a little bit modified excel sheet (as in link below, DataValNameId.xls) but it would show on DataEntry datasheet after selecting product from combo box the value of selected ProductId (instead of Product) on column B and also put the value of the Product on the same row to Column C how could I do it ? > Hi > just make the source list larger or use a defined name which adapts > automatically if you add more products > see > http://www.contextures.com/xlNames01.html#Dynamic > > -- > Regards > Frank Kabel > Frankfurt, Germany > > >&g...

Re: CDialog (OOP Issue)
Doug, > Fahad Ashfaque wrote: > > >Hi, > > I am trying to make a class for asking confirmation > >from user, "yes", "no" , "yes to all", "no to all". My > >class privately inherits CDialog (as i dont want user of > >my class to be in issues of wnd, i want him/her to only > >specify which message to ask, when to ask, whats reply > >now). Everything is working fine but when I try to do the > >following > > > >m_ConfirmDialog = new CConfirmReplace((void*)AfxGetApp()- > >>m_pMainW...

Where do I post questions re SkyDrive?
This is a multi-part message in MIME format. ------=_NextPart_000_0010_01CA6DAA.4FC292E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Good People, Where do I post questions related to SkyDrive? My specific questions is: How do I eliminate SkyDrives renaming of a downloaded file with a "_" = character at the start and at the end of a filename? Thanks, karl ------=_NextPart_000_0010_01CA6DAA.4FC292E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ...

Re-paginating an A5 booklet
I've created a 16 page A5 booklet in Publisher - works beautifully: pgs 16 & 1 on the first page, 15 & 2, 14 & 3 etc. Exactly how I wanted it. However, I now want to create a downloadable version that is in page order, i.e. an A5 e-document with pages 1 - 16 in order. Any ideas on the best way to acheive this? Apologies if this question has already been answered. Cheers, Jon S Jon <Jon@discussions.microsoft.com> was very recently heard to utter: > Apologies if this question has already been answered. I've answered this question before, but can't think o...

Formatting changes everytime document re-opens
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have a lengthy curriculum document that uses a variety of headings, etc. <br><br>Whenever formatting is applied (graphics, text, etc. are arranged on a particular page) it never stays that way after being saved and re-opened. If the document gets opened by others using an older version of pc office (97-2004) OR pc office version 2007 the formatting is off by a few spaces hence throwing the entire document off. <br><br>Tried inserting section breaks for now and it seems to be working but I&#...

RE: Anyone want a HOWTO on E-mail templates?
Dave, Please email me a copy too, as I've beens struggling to figure this out. jeremy_pyles at hotmail dot com "Dave McGuire" wrote: > I just wrote up a full doc, with screenshots, on how to work with email > templates. Here's what's covered: > HOWTO: work with Email templates in CRM 1.2 > Introduction > More information > How to create a template and include graphics > Using the Template > Making a template available to the company > Using an organization-wide template > Modifying or deleting an organization-wide template > > I an...

Locking Code In Individual Macros
Is there a way to lock one macro for viewing without affecting all macros in the workbook? I need to protect the Workbook_Open macro but the user needs to be able to view other macros for troubleshooting. If not, is there a way to change the font color on only one macro? Thanks Dear Carl: Why don't you put all your "protected code" in a Sub that will be stored in a protected module? That way you can call the Sub from the Workbook_Open event. Hope this helps. Please rate this post. G.Morales "Carl Bowman" wrote: > Is there a way to lock one macro for viewi...

Where is the scroll lock option?
I want to activate new cells when scrolling in Excel. How do I unlock the current cell? Thanks! Rusty When you try to select a new cell does the cursor select all cells as you move around? Hit F8 to toggle out of Extended mode. Sometimes tapping the wheel on a wheelie-mouse will do the trick. If no joy, see David McRitchie's notes on "ghosting". http://www.mvps.org/dmcritchie/excel/ghosting.txt Gord Dibben Excel MVP On Fri, 18 Feb 2005 07:19:03 -0800, RustyO <RustyO@discussions.microsoft.com> wrote: >I want to activate new cells when scrolling in Excel. How do...

Lock Out Users for Maintenance
Is there a way to temporarily lock out all but the "sa" user? This would be very helpful when tasks such as Check Links is running. Mike, I guess the easiest way is to revoke users access to the company. Regards, -- Mohammad R. Daoud MVP, MCP, MCBMSP, MCTS, MCBMSS Mob: +962 - 79 -999 65 85 Great Package For Business Solutions daoudm@greatpbs.com http://www.greatpbs.com http://mohdaoud.blogspot.com/ "MikeWal" wrote: > Is there a way to temporarily lock out all but the "sa" user? This would be > very helpful when tasks such as Check Links is runni...

How do I re-save a file in money ?
So I have files in Money - when I go to update them. I am invited to save to a new totally new file. How can I just save ? ( as in MS Word etc) I'm not sure what you mean by "update". In general, you don't ever "save" a money file unless doing something esoteric like a file restore. Please identify version, exact message, precise circumstances, etc. "rodeo" <rodeo@discussions.microsoft.com> wrote in message news:99820D77-3242-4F5B-856B-9827DCB63706@microsoft.com... > > > So I have files in Money - when I go to update them. I am i...

Re: OpenForm Macro
PO number "Endo" <3zc7s7@bma.biglobe.ne.jp> wrote in message news:... > > "dirtrhoads" <dirtrhoads@discussions.microsoft.com> wrote in message > news:FE05F4CB-006D-4891-BA95-0FA20E875115@microsoft.com... >>I have set up an OpenForm macro on a double click event in a subform. The >> subform is titled Active Orders at Belmont Subform. The form I have set >> to >> open is Order Details. I have set up the macro to open Order Details when >> I >> click on the PO_Number from my subform and it opens perfect, how...

How to tell if you're running from within the development environment
Quick question: How can you tell programatically if you're running an application from inside VC++, as opposed to having run the subsequent executable? TIA P p05ter@yahoo.co.uk wrote: > How can you tell programatically if you're running an application from > inside VC++, as opposed to having run the subsequent executable? IsDebuggerPresent But Ctrl+F5 won't tell you the debugger is present, because under those conditions, it isn't. joe On Fri, 23 Sep 2005 14:56:34 +0200, Mihajlo Cvetanovi? <mac@RnEeMtOsVeEt.co.yu> wrote: >p05ter@yahoo.co.uk wrote: &g...

How to make a control locked
Can you help me ? I have 2 controls on the subform, called cartons and quantity.I want to make the control quantity be locked and not enabled when i enter something. Therefore on the OnEnter event of the control i have the command Me!Quantity.Locked = True Howeverr, i have a delete command in the quantity control and somehow the control is not locked and carries out the delete command which is not what i want.Can you help me ? The command in the double click event of Quantity is : Private Sub Quantity_DblClick(Cancel As Integer) Call EnableControl("Cartons", True) Forms![Product...

Re: MICROSOFT MONEY 2005
I'm assuming you converted 2004 file to 2005. If this is so, money will generate a backup of 2004 before converting. Do a search for a file ext *.m1? or *.mn? <<Okay MVP's. I concede. Like John Kerry, I admit defeat. I should have backed up the Money 2004. I should have backed up my data. Still, does anyone have a fix to this problem? I guess it's happening to hundreds of people. Anyone hear an answer yet? ...

VAT Return - Missing entries in 'VAT Return Detail
Creating first VAT Return Reports since upgrading to version 10 and having problems. Total Value of Purchases on VAT Return Summary report is correct. The VAT return Detail report misses some entries and therefore Net Amounts do not add up to the Total Value of Purchases on the summary as it should do. The missing entries appear to be from documents with more that one tax detail id allocated to the transaction (i.e part 0% VAT rated and part standard VAT rated). Has anybody seen this before? ...

Outgoing address re-written
My test account has two recieveing email addresses user1@foo.com user2@barr.com with user1 being the default address. Obvioulsy if I attach with Outlook in exchange mode all mail going out comes from user1. However If I attach using Outlook express in IMAP/SMTP mode and set the email address and return address to user2 the message at the recieiving end still comes from user1. It doesn't seem to happen if I use out 5.5 server as the gateway, only the 2003 server. Any ideas ? Andy I suppose you have the "targetAddress" attribute for the user-account set to user1. D...

Do money updates install when you're not admin?
I noticed when I first start using money it told me to log on as administrator so that the updates can take effect. Is this true of all money updates? When I see the message "Money update recieved" does that mean it has also been installed or do I have to log in as admin to complete the process? In microsoft.public.money, Brian H wrote: >I noticed when I first start using money it told me to log on as >administrator so that the updates can take effect. Is this true of all money >updates? When I see the message "Money update recieved" does that mean it >has a...

Password protection
I have apprx 21 user prompts set up for Outlook 2007. My questions are: 1) is there a limit of profiles, that can be set up? 2) if I use a PST password - can it be the same as the profile password? 3) I am correct in saying that when I get prompted for the profile to use - it will prompt me for both the PST and Profile password? John D Leonard -- Sage <sage.grp@comcast.net> wrote: > I have apprx 21 user prompts set up for Outlook 2007. > > My questions are: > 1) is there a limit of profiles, that can be set up? I've never heard of one. > 2) if I use a PST pass...

Re: Stop next cell being selected on Enter
I don't know why Excel reacts this way, but when the worksheet is protected, make sure that the user is allowed to select both locked and unlocked cells. They still won't be able to make changes to the locked cells, but this will prevent the cursor from moving. "Ken G." <KenG@discussions.microsoft.com> wrote in message news:517AD5C2-AB5C-4BA5-A832-9DC74B4BEEB5@microsoft.com... > I have a sheet which has only 3 input cells, but only one input cell is > required for a user in a given state. I've disabled the "move selection after > enter" function ...

outlook locks up when trying to print an email
Occasionally MS Outlook 2002 will lock up when I try to print an email. The only way to correct for this is to hard boot my computer. Has anyone ever encountered this? ...

Editing in sub-form is locked
I have a sub-form that when loaded seperately allows edits. The underlying query also allows edits to update the base table. The query contains simple references no calculated fields or multi-join situations. However when viewing the mainform(w/sub-form too), the textboxes are locked (I.E. clicking on them is not registered). Properties attached to the sub-form: Form property Allow Edits: yes (Additions, Deletions are both no, I only wish to allow changes to existing table data) TextBoxes for fields that I want to edit, Enabled: yes (some of the Textboxes ARE disabled, greyed-out, o...

Re: Moving to IMAP without winmail.dat
Marcel St�r wrote: > I tried, using Outlook 2002 SP3, to move from POP3 to IMAP. > Apparently, I stumbled upon the dreaded winmail.dat problem: each > file, which I move from Outlook on the IMAP server, gets a > winmail.dat attachment attached. > In accordance with > http://support.microsoft.com/default.aspx?scid=kb;en-us;280857#appliesto > this problem should arise only with Outlook 2002. I'm certain, > however, that I read somewhere else that this problem occured with > any Outlook version. > 1. Is that indeed the case? > 2. Can this be avoided somehow? ...