BeginWaitCursor and EndWaitCursor are used to display an hourglass
cursor. lock is used to synchronize access to a resource from multiple
accesses across threads. They are not related.
my c++ code;
----------------
BeginWaitCursor();
if (test1)
//do stuff
else if (test2)
//then do this stuff
EndWaitCursor();
but if all i'm doing is showing an hourglass i can simply use the cursor
class?
Nicholas Paldino said:
BeginWaitCursor and EndWaitCursor are used to display an hourglass
cursor. lock is used to synchronize access to a resource from multiple
accesses across threads. They are not related.
What are you trying to do?
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
try
{
// Put your processing here.
if (test1)...
}
finally
{
Cursor.Current = Cursors.Default;
}
lock will serialise access to the contained code over multiple threads of
execution; probably not what you require in this instance.
The finally block above ensures that if any exceptions are thrown that the
cursor is restored to the default.
mgonzales3 said:
my c++ code;
----------------
BeginWaitCursor();
if (test1)
//do stuff
else if (test2)
//then do this stuff
EndWaitCursor();
but if all i'm doing is showing an hourglass i can simply use the cursor
class?
Nicholas Paldino said:
BeginWaitCursor and EndWaitCursor are used to display an hourglass
cursor. lock is used to synchronize access to a resource from multiple
accesses across threads. They are not related.
What are you trying to do?
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.