BeginWaitcursor doesnt work with Mouse Pointer

Hi
I am facing a problem with the Wait Cursor
The application requirement is that on click of a button, the Cursor should change to the Hour Glass Type till the function returns
So, the code written is 
void CMyClass::OnExecuteButton(

 BeginWaitCursor()
 //Do some lengthy processin
 EndWaitCursor()

The hour glass gets displayed just for a short time as i click the button.But after that during the execution it is not displayed. Using  the keys i rightly cannot do any other operation on that dialog during the execution of the function but the mouse pointer is allowing me to do the same
I have tried using CWaitCursor too. But, it behaved the same way
Can someone suggest me some solution for the same.
Thanks in adv 
0
anonymous (74721)
5/10/2004 10:36:03 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
604 Views

Similar Articles

[PageSpeed] 56

>I am facing a problem with the Wait Cursor.
>The application requirement is that on click of a button, the Cursor should change to the Hour Glass Type till the function returns.
>So, the code written is -
>...
>The hour glass gets displayed just for a short time as i click the button.But after that during the execution it is not displayed.

I suspect that your lengthy operation is allowing Windows messages to
be processed - in which case, as soon as your dialog processes a
WM_SETCURSOR message, the cursor will revert.

To resolve this situation, handle the WM_SETCURSOR message and change
the cursor.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2060)
5/10/2004 11:26:36 AM
If indeed you app is processing messages, as suggested by Mr. Lowndes, then
this article http://www.codeproject.com/dialog/persistentwaitcursor.asp
explains what's happening and offers a CPersistentWaitCursor class that
helps to fix it.

Regards,
Mike


"David Lowndes" <davidl@example.invalid> wrote in message
news:bjpu90thkdnd8vajho93f3qkicbm3kqpkb@4ax.com...
> >I am facing a problem with the Wait Cursor.
> >The application requirement is that on click of a button, the Cursor
should change to the Hour Glass Type till the function returns.
> >So, the code written is -
> >...
> >The hour glass gets displayed just for a short time as i click the
button.But after that during the execution it is not displayed.
>
> I suspect that your lengthy operation is allowing Windows messages to
> be processed - in which case, as soon as your dialog processes a
> WM_SETCURSOR message, the cursor will revert.
>
> To resolve this situation, handle the WM_SETCURSOR message and change
> the cursor.
>
> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq


0
5/10/2004 7:37:53 PM
I tried overriding the WM_SetCursor Event. But still i am facing the same problem. The code Structure is as follows 
Class CBase is derived from CDIalog & Class CDer is derived CBas
There is a btn in CDer class Dialog and its correspoding function  OnbtnClick has been written in CBase class. So, by default, the Der calls the Base class functio
CBase::OnBtnClick(

  m_bCur=TRUE
   BeginWaitCursor()
 //Call some functions which have been overriden in Der clas
// these fucntion update Dialog Values
  EndWaitCursor()


In OnSetCursor(), m_bCur is been checked, if set, then RestoreCursor is called. By defualt, it has value of FALSE

CLd u pls tell me what the prob wld be 
Is it because the Cursor is called in Base which is not associated to a particular Dialog ID O
is it because UpdateData is being done
Please help

0
anonymous (74721)
5/11/2004 2:26:06 PM
>In OnSetCursor(), m_bCur is been checked, if set, then RestoreCursor is called.

RestoreCursor won't do what's needed. You have to call SetCursor in
there and return true to not pass the handler on.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2060)
5/11/2004 3:45:31 PM
Reply:

Similar Artilces:

Archive not working in 2004?
I just installed Money 2004 Deluxe, and imported my 2003 file with no problems. I then ran the archive function to remove all transactions prior to 1/1/04. Although it took about 10 minutes (for a 10MB file), I notice that some accounts still have all of their 2003 transactions still in there. What's going on? What did I miss? In microsoft.public.money, James wrote: >I just installed Money 2004 Deluxe, and imported my 2003 >file with no problems. I then ran the archive function to >remove all transactions prior to 1/1/04. Although it took >about 10 minutes (for a...

IF statement not working
This is a formula I have in my Excel spreadsheet that is not working correctly. =IF(AND("12/1/05"<L2,L2<="2/28/06"),J2,0) This formula works correctly with numbers, but not with dates. I have the L2 cell format as a date. This formula will return 0 when the date in L2 is 12/20/05 for example. If someone could help me with this formula I would really appreciate it. Thanks, First, the display formatting of L2 has nothing to do with the value stored in it, so changing its number format won't affect the formula (other than using Text). one way: =IF(AN...

BeginWaitCursor() does not work effectively?
Dear all, I have a computationally intensive task in a program and used BeginWaitCursor() and EndWaitCursor() pair to indicate that the program is running (based on shape change of mouse pointer when moving it on the top of the dialog). To avoid a dialog refresh problem, I insert the MessageLoop() routine within the loop as shown below. By doing so, however, the BeginWaitCursor() does not work anymore, at least I could see it is working because the shape of mouse pointer does not change any more if I move it on the top of the dialog. Could you please advice and how can I avoid that? Thank yo...

Accelerator key not working
Using Visual Studio 2005 + Codejock Toolkit Pro. There are all the usual keys already defined in my accelerator table - Shift + VK_DELETE for example does ID_EDIT_CUT. I want VK_DELETE (with no modifier - shift, ctrl etc) to map to ID_EDIT_DELETE - an option I have on my Edit menu and also on a toolbar. I have added the accelerator key to the list and it looks very similar to the ID_EDIT_CUT line with the Modifier set to None instead of Shift, but nothing happens when I press Delete. The menu option is enabled and works when selected from the menu or toolbar button, so what else do I n...

service reference not working
I've a web site that contains a remote service reference (binded to a tcp:// WCF service). I can add the reference, I can see endpoints and interface and select them, and VS creates the service referce. No error. Bun no object proxy is available on my namespace! I cannot refer to the remote service in any way... :( any idea? I've create a blank new project and added a reference to the same service, and all is ok :( Trapulo wrote: > I've a web site that contains a remote service reference (binded to a > tcp:// WCF service). That can only happen on...

Date sorting not working?
Hello all, I am working with a 5 column/35 line spreadsheet and need to sort th contents by date (column E). I have made sure that the column i formatted for date (ex format>cells>DATE>03/01/05). When I select th columns go to DATA > SORT > Column e ascending it sorts up until lin 30 or so then it just does the willy nilly thing. I cannot figure ou why this simple function is giving me more greys. Any ideas? Thanks Tracy :confused -- sarja ----------------------------------------------------------------------- sarjak's Profile: http://www.excelforum.com/member.php?ac...

Hows do I get rhe recently usef file indicator in options to work
I cannot get the gray area in general options to highlite. I would like to have all of my recently used file to come up. Have you installed tweakui in windows, if you have turned off document list there is no file list in excel either http://support.microsoft.com/default.aspx?scid=kb;en-us;284896&Product=xl2003 -- Regards, Peo Sjoblom (No private emails please) "bubblehead" <bubblehead@discussions.microsoft.com> wrote in message news:B0062631-654E-49A7-8B7C-B276DD296EB3@microsoft.com... >I cannot get the gray area in general options to highlite. I would like t...

Autocomplete not working
Hi, Although Autocomplete is checked in Excel "Options", it is not working. If I have written 'abcxyz' in a column, and I write the letters 'ab' or even 'abc', in the same column, Excel doesn't suggest the word 'abcxyz'. I'm using Excel 2003 SP2. SantistaS Have you run through the suggestions in Help ("Microsoft Excel doesn't always display the AutoComplete list" topic). From what you posted, I'd guess that you're trying to autocomplete outside the current data region. In article <e57uAzTEGHA.3064@TK2MSFTNGP...

After Reparing: Reply Function Doesnt Work
I had some problems with Excel not giving me correct histograms, so I did a detect and repair function... Now my Outlook data was wiped out... I tried to put everything back to normal but now everytime I click reply on a message Outlook says.. "Microsoft Word is set to be e-mail editor. However, Word is unavailable, not installed, or is not the same version as Outlook. The Outlook e-mail editor will be used instead. An OLE registration error occured. The program is not correctly installed. Please run setup again for the program...." And then it opens the Outlook email editor i...

Conversion from MS Works
I have some MS Works spreadsheet files saved to disk. My new computer does not have MS Works, but does have Excel. I cannot open the MSWorks spreadsheets in order to copy and paste them into Excel so I can work with them. Any ideas? Is there any such thing as a MS Works spreadsheet viewer? I have not been able to find one. Thanks for any help you can give me. You can download the Office conversion tools from the Office Update web-site to read any MS-Works files. >-----Original Message----- >I have some MS Works spreadsheet files saved to disk. My >new computer does not ...

OpenEvent() doesnt work
Hi, I am having problem with OpenEvent(). I have 2 applications, in which, one is creating a named event with CreateEvent() call, and registers for call back functino for that event. The another application opens the named event, and signals it. It works fine when I execute the .exe directly from console. But, If i scheduled the .exe with Task scheduler, the task get triggered, but my OpenEvent() failed, and GetLastError() returns ERROR_FILE_NOT_FOUND. I ensure there is no race condition between the calls CreateEvent() and OpenEvent(). Also, I scheduled the task with the same acc...

TLS not working due to invalid certificate
without changing anything on our exchange 2007 server I got folowing error after a reboot: A certificate for the hostname "www.eu.company.com" could not be found. SSL or TLS encryption cannot be made to the IMAP service. running Get-ExchangeCertificate |fl gives me following result: AccessRules : {System.Security.AccessControl.CryptoKeyAccessRule, System.Security.AccessControl.CryptoKeyAccessRule, System.Security.AccessControl.CryptoKeyAccessRule} CertificateDomains : {www.eu.company.com, autodiscover.eu.company.com, mail.eu.company.com,owa.eu.company.co...

How can I set up a work schedule in Excel?
I would like to set up a work schedule that has a weekly overall schedule which automatically fills in each day's schedule. Suggest that you post what the schedule would look like both weekly an daily so we can understand what you want -- neopolita ----------------------------------------------------------------------- neopolitan's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=61 View this thread: http://www.excelforum.com/showthread.php?threadid=47176 ...

Check Boxes Have Label Controls That 'Work'
In developing this form, I created a bunch of check-boxes with "Yes" as their defaults. Let's say one is called 'PCA_L' and its label control were called "label37". I have 'discovered' that when I click in "label37" the effect is to 'toggle' the check-box's value to the other one. I am running A2002 btw. So, here's my question: can I have the color of the label conditioned on the value of the check-box? At this point, 'label37' has a default white bckgrnd and black lettering. When it's used to 'toggle' ...

Outlook2003 stopped working
I had to revert back to Outlook 2000 because I got the following error: 'Cannot start Microsoft Outlook. Unable to open the Outlook window. The set of folders could not be opened'. It gets about 3/4 the way opening, then I get the error and it shuts itself down. Outlook 2000 is working just fine. I tried renaming the file outcmd.dat to outcmd.old, then reinstalling 2003. Didn't work. New profile didn't work either. Not sure why it stopped working all of a sudden. ...

Keyword EXCEPT not working
Folks, Does the keyword EXCEPT work only in SQL Server 2005 and later versions? Thanks! J.S. Yes. Tom "Jack" <jack@nospamplease.com> wrote in message news:usaNNmFULHA.796@TK2MSFTNGP02.phx.gbl... > Folks, > > Does the keyword EXCEPT work only in SQL Server 2005 and later versions? > > Thanks! > J.S. Thanks, Tom. Could you advise me of any workaround that may accomplish the same thing in SQL Server 2000? Let me explain the issue I have been trying to solve but without success. It seems very simple but just doesn't get so...

windows doesnt start
my windows was being locked when i attempt to update it. and then blue screen comes. today after months, i tried to upate again. but now, it is colapsed. it restarts itself when the windows logo comes. it takes half an hour to see the logo, after the logo a grey scren comes, and after haf an hour with grey screen it restarts, again the same things... i am using 32 bit xp proffesional. ca anybody help me ...

Outlook 2000 Customize Outlook Today button does not work
Does anyone know why the Customize Outlook Today button does not work and what steps I need to take to get make it work. This is a new hard drive with Win 2000, Office 2000, and Outlook 2000. I have not done anything to corrupt it that I am aware of. When I push the button, nothing happens. Any insight would be greatly appreciated. Thanks "John" <anonymous@discussions.microsoft.com> wrote in message news:042801c3ddf5$80deb1b0$a001280a@phx.gbl... > Does anyone know why the Customize Outlook Today button > does not work and what steps I need to take to get make i...

Customer charge Accounts don't work.
We just upgraded from Quicksell 2000 and everything transfered great. The charge accounts transfered but we can not add new charges to them. The error we get is "the charge has no slip receipt". Can't figure out how to set that up to create charges. Can anybody lend a hand. Beaver, Are you trying to use a QS2K receipt template? If so, try an RMS one. I'm assuming you have created an Account type for your charge customers and a Payment type for charge accounts. As a test, create a new customer, Account tab, change the Account type to your charge account, give ...

can outlook work without joining local domain?
we have situation where client wants to use exchange server 2003 without having workstations to join domain. Can this work? Thank you in advance. arun Yes, it works. -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- "arun mx" <arunmx@discussions.microsoft.com> wrote in message news:7EB88EC5-3ACF-45CF-B14C-B75E44604872@microsoft.com... > we have situation where client wants to use exchange server 2003 without > having workstations to join domain. Can this work? > Thank you...

Why doesnt this work
Dear All, Can you have a look at this and please tell why it doesnt work Sub CopySheetAsHTML() Dim fName As String Dim wks As Worksheet Set wks = ActiveSheet fName = wks.Range("J4").Value With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _ "I:\" & fName & ".htm", wks.Name, "DataRange", _ xlHtmlStatic, wks.Range("J4").Value) .Publish (True) End With End Sub Many Thanks in advance Steve Where to start? 1. Do you have this code in a standard Excel module? 2. Do you have a worksheet (not a chart sheet) a...

Save & close not working in LiveCalendar
Can no longer add or edit an event on PC because Save & close doesn't work. Why? I have tried two other posts for this problem and they haven't appeared. -- Rupe ...

OWA Not Working for Only One User
I have Outlook Web Access (OWA) installed on my SBS 2K server. There's only a single user who can't get OWA working for them. The URL http://servername/exchange/faileduserid returns a HTTP 404 - File not found error. I've compared this user to others and can't determine why this user alone can'e get into OWA. Please advise me on how to diagnose and correct this problem. - Michael Faklis <Michael_Faklis@EvolSwSys.net> "Michael Faklis" <Michael_Faklis@EvolSwSys.net> wrote in message news:57idnRHcqNczfKLZRVn-iA@megapath.net... >I have Ou...

Strange characters
In my Working budget I see strange characters instead of the values of column % of income. When I pass the mouse over the area of the strange characters they change to another strange string of characters. Does anybody has this problem? My money is 2007 deluxe. Thanks in advance. Havok I do, MM 2007 home and business. No clue here why or how this happens. "Havok" <Havok@discussions.microsoft.com> schreef in bericht news:29B3F475-F08A-494C-AAB6-0B0B600AB7E3@microsoft.com... > In my Working budget I see strange characters instead of the values of > column > % ...

Explorer Toolbar doesnt display Dialog
Hi, I wrote a Toolbar for the Internet Explorer, using the sample KBBar. All works well, but I've got a little problem: I created a Dialog , let's say it's in class CAboutDlg, and now I want to show it as a modal dialog. But the code does not work: /* code here will be executed */ CAboutDlg aboutDlg; aboutDlg.DoModal(); /* does noting ?!? */ /* code here also works well */ Any ideas why this code won't work? The dialog should be visible after a call of DoModal(), or not? Thanks for help, �ai�� ...