OnTimer() Not Being Called after timer is set up (VS C++ 6.0)

OK, here is what I have done.

 

I am looking to use a timer to complete some refresh operations every 2 
seconds.  However, I cannot get my OnTimer()function to be called.

 

I set up a timer with the following line of code:

 SetTimer(1, 2000, 0);

Then, I have the Ontimer function, which I created from ClassWizard as a 
message handler for WM_TIMER.

void CProbeTalkMenu::OnTimer(UINT nIDEvent) 
{
   m_szStatus += "*";
   UpdateData();
   CDialog::OnTimer(nIDEvent);
}

OnTimer() is never called.  I am afraid that I am failing to do something 
grossly important.  Can anyone explain what my problem might be?



0
6/7/2006 7:12:02 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
1449 Views

Similar Articles

[PageSpeed] 16

Brett Feero wrote:
> OK, here is what I have done.
> 
>  
> 
> I am looking to use a timer to complete some refresh operations every 2 
> seconds.  However, I cannot get my OnTimer()function to be called.
> 
>  
> 
> I set up a timer with the following line of code:
> 
>  SetTimer(1, 2000, 0);
> 
> Then, I have the Ontimer function, which I created from ClassWizard as a 
> message handler for WM_TIMER.
> 
> void CProbeTalkMenu::OnTimer(UINT nIDEvent) 
> {
>    m_szStatus += "*";
>    UpdateData();
>    CDialog::OnTimer(nIDEvent);
> }
> 
> OnTimer() is never called.  I am afraid that I am failing to do something 
> grossly important.  Can anyone explain what my problem might be?

Make sure you don't call SetTimer until the dialog has been created and 
fully initialized.  SetTimer uses the dialog's m_hWnd.  But if you are 
calling too early it doesn't yet have an m_hWnd.  The first safe point 
is in OnInitDialog, after it has called CDialog::OnInitDialog.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
6/7/2006 7:39:39 PM
Reply:

Similar Artilces:

bcc can't be set up automatically
Anyone know a way to tell Outlook to automatically bcc another person on every new message sent out? This is a Netscape feature that doesn't seem to be available in Outlook. Hi Roberto, As far the information i have to Automatically setup the bcc you woudl have to develop a VBA code that can be used in Outlook. There are no settings in Outook for automatic update bcc. To give you an easier option there are 3rd party links and software that can be downloaded and intergrated with Outlook to set bcc as automatic. There are many add-ins which can be added to Outlook. Thank You... ...

office 2003 w/ windows 7 requires reacceptance ot T&C's each time
office 2003 w/ windows 7 requires reacceptance of T&C's each time i open work or excell or any office program. How do I get rid of this? Boot into Safe mode in Windows 7,open any Office app and then accept the terms -- Peter Please Reply to Newsgroup for the benefit of others Requests for assistance by email can not and will not be acknowledged. "mouser830" <mouser830@discussions.microsoft.com> wrote in message news:E7B7602D-F5D8-4559-98EF-A2CCC1E2D6FD@microsoft.com... > office 2003 w/ windows 7 requires reacceptance of T&C's each time i op...

building form @ runtime vs. hiding existing controls
I'm trying to decide just how bad runtime design is. Most opinions seem to steer clear of adding controls, events, etc at runtime. Instead, y'all advocate keeping controls on the form and hiding them as necessary. In my application (which will not be an MDE) , each user session builds a new form - from scratch. Once the form is built, there are no design changes. And when the user is done the form object is deleted. Troubleshooting may be more difficult with a form that only exists at runtime. OTOH, documenting and tracking unused controls (or not having enough controls, ...

Pivot Table formatting #6
When I format my pivot tables I have "preserve formatting" checked under "PivotTable Options", and "Autoformat Table" unchecked. Even so, I either lose portions of my formatting, or different formatting is applied when I refresh. Does anyone know what I am doing incorrectly or have any other suggestions? Thanks, Phil Other things to try -- if they don't work, you could record a macro as you refresh and reformat the pivot table. Then, run that when you want to update. --Instead of selecting the cells to format the numbers, right-click the field but...

excel, worksheet, set print area, position selection on printed pa
Office 07, Excel. Print area is set, print preview displays selection, always on far left of page. I want to choose the position on the page, eg centered or right aligned etc. Help please. Hi, To get your printout to center on the page chose Page Layout, click the Page Setup quick launch button (bottom right corner of the Page Setup group). Choose the Margins tab, click Horizontal. There is no command to right align a printout, but you can change the left margin to force the printout to the left. -- If this helps, please click the Yes button Cheers, Shane Devenshire "Eve Al...

Clearing security settings
I am setting up a new server that will be home to GP version 8. I am migrating from 7.5 to 8. I want to clear out all users, advanced security, and standard security settings and recreate them on the new server. Anybody ever scripted this? I assume I want to truncate tables, but I don't know which ones, other than what is show in techkno Steps to remove Advanced Security (874401). TIA If you run a delete statement on the SY02000 table, it will remove all settings, then you can run a reconcile against security restrictions and user access. "Cindy Lange" wrote: > I...

How do I set up a formula in excel that is the tenth root of 7 ve.
How do I set up a formula in excel that is the tenth root of 7 versus the square root of 7? try the formula =7^(1/10). HTH Alan P. "kestig1" <kestig1@discussions.microsoft.com> wrote in message news:99C16AB7-8BD6-4671-B138-5F2961E46067@microsoft.com... > How do I set up a formula in excel that is the tenth root of 7 versus the > square root of 7? ...

Why should I upgrade to 8.0?
If you were currently running MBS 7.5 at the moment, are there any compelling reasons to move up to 8.0? Or would you be better off waiting it out for their 9.0 release? If you haven't seen reason enough, you might as well wait. When you do decide to upgrade, you will still have to go through 8.0 as there is noupgrade path from 7.5 to 9. Your VAR will do both upgrades one after the other so there should be no downtime. HS "ElmerT" <elmer.tagarino@gisimplement.com> wrote in message news:%23gx97N6zFHA.2652@TK2MSFTNGP14.phx.gbl... > If you were currently running...

Mailbox Restore #6
Hi! Im about to restore a SBS 2003 server with exchange (2003) after a system crash. I don't want to restore over my new installed machine, so what's the easiest way? Im only interested in the mailboxes and public folders content. Software for extracting directly fom edb files are to expensive, or is there any cheap one? :-) /Jonas On Sun, 5 Mar 2006 18:36:24 +0100, "Jonas Nilsson" <jonas_nilsson@hotmail.com> wrote: >Hi! > >Im about to restore a SBS 2003 server with exchange (2003) after a system >crash. > >I don't want to restore over my ...

Missing destructor calls on exit
Sorry if this is well covered ground, but many of the tactics I tried to employ from other threads didn't pan out (and most importantly allow me to understand _why_ this is happening). I have a doc/view mdi app. My runtime library is multi-threaded debug DLL. On exit of the application (via file..exit or the X button), I get a bunch of memory leaks. Some from a modeless dialog (whose destructor is not called), the CMainFrame itself (all 2K), the CDocManager, CMultiDocTemplate, and a CCmdTarget (these are created by the CWinApp I believe). A breakpoint gets hit in my CMainFrame (which ...

4.0 Acceleration Software?
Have heard tell of a software "maybe called accelerate" that can be installed on the CRM server, which will increase speed and performance. My clients are complaining of slowness since crm has been installed. They all use Outlook client for desktop, and say there is a definite latency. I've been searching the web, but coming up empty on a software for this. Is it an urban myth or a secret that needs to be be shared? ...

Great Plains integration to CRM 4.0
does anyone know if there is integration of great plains with crm 4.0? we have crm 3.0 integrated to great plains 8.0 and want to upgrade both. Hi Shawn, There is no Microsoft connector yet for CRM 4 and GP. There is one for CRM 3 and GP. Other options are to use • some third party tools like Scribe • or use Microsoft BizTalk • or do custom Programming. -- uMar Khan :: MS CRM MVP Microsoft CRM Consultant Email :: imumar at gmail dot com Blog :: http://umarkhan.wordpress.com MVP :: https://mvp.support.microsoft.com/default.aspx/profile/umar.khan "Shawn" wrote: > does an...

Set default time zone for all users
Is there a way to make the time zone default to a certain value so that I don't have to go into every user and change it to the correct zone? No. Each user must change their own timezone settings. I have no idea why Microsoft do not pick up your computers timezone. Hopefully this will be changed in a version 2.0 release "Jack Black" <anonymous@discussions.microsoft.com> wrote in message news:6F5F4A10-B6AD-420C-9ACB-F73A13FDABB9@microsoft.com... > Is there a way to make the time zone default to a certain value so that I don't have to go into every user and change i...

Can I set my custom views on Pivot table
I want to get Pivot table data on my invoice, is it possible to set custom views so that I can get Pivot table results on invoice format, I've tried views that offer excel but it doesn't offer custom views please help Thanks ...

Prices and cost Set to zero when exporting a new store
When I export a new store with 1.2.085v from headquarters all the cost and price information is set to zero. I have seen that there is a fix for 1.3v but i cannot seem to find any other fix for our version. Any suggestions? Thanks Joe Just run worksheets to update the cost and price. Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.com ---------------------------------------------- Please DO NOT respond to me directly but post all responses here in the newsgroup so that all can share the information. Joe Gonzalez wrote: > When I export a new store with ...

Z Report Customer Count vs Hourly Sales
My Z report shows customer count of 380 and hourly sales total of 384. Why the difference? This happens all the time. Thanks Your glass is: Half-Empty : Do folks at register forget to ask "Is there anything else I can help you with?" Half-Full: Your impulse items at POS are working -- better late than never! sammy wrote: > My Z report shows customer count of 380 and hourly sales total of > 384. Why the difference? This happens all the time. > Thanks -- ______________________________________________________ Larry Leveen OlyBikes Locally-Owned B...

Import Templates for Dynamics CRM 3.0
Hi all I am trying to use the standard import file into Leads, and it is coming up with data type not valid, length not valid however I am 100% sure it is correct. Have any of you out there got formatted xls files that have the correct data types. field lengths that we could possibly use as a template to see if it is actually my error? Regards Wayne Lockey ...

SPA vs POP over SSL (SSL for Exchange)
Exchange 5.5 sp4, W2K serve I have a few roaming clients using Outlook with POP to our internal Exchange server. My question is what are the advantages between using SPA Secure Password Authentication vs. POP over SSL I am thinking SPA uses a challenge and response for the password but does not encrypt anything. POP over SSL encrypts everything including password and mail data. So SPA only protects your password from spying eyes. Right? In order to force my users to use SPA, what can I set on my Exchange 5.5 server What do I have to open on my firewall for SPA Also, a while back, I tried ...

CRM 3.0 Email Attachments
I understand the attachments are stored in the DB iteself. I am able to find out which table and fields. I see attachment NAME, MIME TYPE, MIMEID but unable to locate which column in the MSCRM.ActivityMimeAttachment table the content is stored ? Please advice. I am trying to download the attachment from the CRM Database into a folder as a file for a given activityid. ...

VS 2005 beta question
All, I need to complie some code. I am going from 16bit to 64 bit. The job do not want to spend the money on VS 2005.net. If I compile the code with the beta version or trial version of VS 2005.NET will it time bomb on me? Thanks in advance The code won't, but eventually the compiler will stop working. Don't know if the trial will support 64 bit though. I guess you get what you pay for. Tom "karibbean" <sharp_mind@REMOVE.this.email.msn.dotcom> wrote in message news:%23OyZFNUFGHA.1124@TK2MSFTNGP10.phx.gbl... > All, > > I need to complie some cod...

CRM 3.0 Setup err databases already exist on the specified SQL Ser
ReportServer ReportServerTempDB Question : How to clear this problem? The On-Line Help did not applied as SQL 2005 has been installed on SBS2003 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Microsoft SQL Server Reporting Services Cause There are two causes for this error: Microsoft SQL Server Reporting Services is already installed on the specified server. Setup has found a version of Microsoft SQL Server that is not supported by Microsoft SQL Server Reporting Services. Solution One of the following versions of Microsoft SQL Server are required for Microsoft SQL Server Repor...

Outlook xp Offline folders vs O2k3 Cached Exchange mode
I recently upgraded a group of executives from Outlook XP to Outlook 2003. I used the "upgrade" option. I also installed O2K3 SP1. They all have laptops and use offline folders. Several have had various offline folder issues since the upgrade. Is there something I need to configure in order for them to continue to use their offline folders? or Does Cached Exchange mode replace Offline folders? Are there known issues with the upgrade and offline folders? I'm not sure what to look for. Thanks in advance for your time! techguyasap <anonymous@discussions.microsoft.com&g...

CRM 4.0: Do notes carry over in lead conversion?
Hi all, I know that in CRM 3.0, when you convert a lead, you lose the notes associated with it. Is this still the case with CRM 4.0? Is there maybe a way to fix that now--mapping relationships?!? Thanks. Hi, Same is the case in CRM 4. Notes of Lead will stay with Lead after conversion to Account or contact. To move them to Account or contact, you need coding. Llugin or workflow assembly will work for you. -- uMar Khan :: MS CRM MVP Microsoft CRM Consultant Email :: imumar at gmail dot com Blog :: http://umarkhan.wordpress.com MVP :: https://mvp.support.microsoft.com/default.aspx/profil...

Office 2004 SP 11.1.0 installation problems
I'm trying to update Office 2004 on my brand new iBook. I installed Office 2004 from the CD without incident. Then I downloaded SP 11.1.1.0 and 11.1.0 (which according to the MS website is to be installed 1st.) When I try to install, I received a message, "An error prevented the update from completing 11002:2,-14" The "Read Me" file indicates several potential explainatins/solutions none of whice are relevant except for uninstalling Office and then reinstalling it. I tried dragging the Office folder to the trash and reinstalled and am having the same problem. I've t...

Macro Security Setting not applying ...
Help! I have a workbook that will sporadically lose it's ability to run macros even though the macro security setting is set to 'medium'. i.e. - no message box comes up when opening the file and when trying to run any macros, the "cannot run macros ..." box comes up. The only way I can fix this is to open the file, select macro-security setting "low", save the file, open it again, and then return the setting to "medium". This file is out on a shared drive and many of my users need to access this - so the quick-fix noted above really isn't...