SetTimer problem

Hi,
I have an application that requires processing at regular intervals. I have used SetTimer and cal back function to do the processing and it had been working fine (its a service and hence had to add message loop). Recently, in the processing I added one other function that uses a COM dll (a VFP dll to run VFP cmmands). With that, i see intermittent missing timer events (the processing was not done as expected and hence added a log. The log shows that the call back function is not called in between for some random intervals of time). I am not sure why this happens.

What I am looking at now is, considering there is a problem with the timer, what other mechanism I can use for periodical processing? Can I use WaitForSingleObject() with the timeout as my interval instead of the timer? Will WaitForSingleObject be blocking the thread?

Thanks for your time & reply,
Satish
0
anonymous (74722)
4/16/2004 5:56:03 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
420 Views

Similar Articles

[PageSpeed] 20

>I have an application that requires processing at regular intervals. I have used SetTimer and cal back function to do the processing and it had been working fine (its a service and hence had to add message loop). Recently, in the processing I added one other function that uses a COM dll (a VFP dll to run VFP cmmands). With that, i see intermittent missing timer events (the processing was not done as expected and hence added a log. The log shows that the call back function is not called in between for some random intervals of time). I am not sure why this happens.
>

Satish,

The Windows SetTimer mechanism is very low priority, you only get the
timer when there are no other messages to be processed.

>What I am looking at now is, considering there is a problem with the timer, what other mechanism I can use for periodical processing?

You could use the multimedia timer, see timeSetEvent.

> Can I use WaitForSingleObject() with the timeout as my interval instead of the timer? Will WaitForSingleObject be blocking the thread?
>

WaitForSingleObject will block.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2060)
4/19/2004 8:38:52 AM
Reply:

Similar Artilces:

Error 3125 doesn't apply here. So, what's the problem.
<Name> is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long. (Error 3125) The specified name does not follow standard naming conventions or is not a valid parameter or alias name. Check your entry to make sure you have not included invalid characters or punctuation and that the name is not too long. I get the above error message only when trying to run my parameter query. I've named it "Status Report Query" and then tried "Reports I Want" and have also tried other simple names. I really don&...

AD Exch2000 problem help please
Hi When I go into AD Users Computers and Mailbox Rights of a user. I get this popu Microsoft Active Directory - Exchange EXtensio an invalid adsi pathname was passe id no: 8000500 ms ad - exchange extensio I cant change mailbox rights, when I go into ESM (exch sys manager) I cant see mailboxs but they are working as normal 50+ mailboxs on a server What can I do to fix this Thanks very muc Jon This sounds like a permissions problem or ESM problem. I would start by doing a reinstall of the Exchange System Management Tools. If that doesn't do the trick, then you can reinstall all o...

ArraySegnment problem
Hi all I have constructed a custom message encoder for WCF, which works just great. But, now I'm trying to build in encryption which is quite straight forward. The problem is that my encoder works with ArraySegments of bytes. The original segment is a 1024 byte segment with offset 0 and Count = 748 Then I encrypt this resulting in a 1024 byte segment with offset 0 and count =1024 This is send to the server and decrypted to an ArraySegment 100% identical with the original, the only problem is that I now have lost the original count of 748. I have a 1024 byte array...

$Textbox problem
Hi, I'm having a strange problem with placing and formatting text in multiline text boxes. When I assign a string as such: - $message = "line1`r`nline2" Then assign it to the text property of the textbox: - $textbox1.text = $message There is no problem there, the string is rendered as: - line1 line2 The problem I have is that I am retrieving the string from a .ini file which is comma separated Eg:- 4 0,6,card 17,line 1`r`nline2,78,79 So I am assigning $message as: - $message = $line.split(",")[3] In that case I CANNOT get the dratted s...

Problem in CreateProcess
I've write a program use CreateProcess to run a dos batch file. The batch file will run another dos program to process some data files. The batch file directory may contain long file names with space, like: C:\My Applications\test\test.bat The data file is anywhere which may contain long file names with space, such like C:\My Data\Data\Data.txt In DOS mode, I should run it as: "C:\My Applications\test\test.bat" "C:\My Data\Data\Data.txt" My problem is, in CreateProcess, how should I put the parameter for lpApplicationName and lpCommandLine. I've try: lpApplicat...

OWA Authentication problem
Hi All, I have setup basic authentication for Exchange 2000 (sp3) OWA (widows 2000 server sp 4). I made sure that only basic authentication is checked under Directory Security. Half of my users use Linux and the other half Win 2000. From time to time the Windows users get the user/password/domain prompt when they try to access OWA. The Linux users has no problems. When I went to the server, I saw that Integrated Windows Authentication is checked. I unchecked it but it still keep showing after couple of days and I don't know what else needs to be configured so the user/password/domai...

aol outgoing email problem
I am unable to send messages to all AOL addresses from outlook 2000. I receive these messages fine. The problem is not with my ISP as I can send messages directly from that account. Any ideas? Thx in advance J j <anonymous@discussions.microsoft.com> wrote: > I am unable to send messages to all AOL addresses from > outlook 2000. I receive these messages fine. The > problem is not with my ISP as I can send messages > directly from that account. Any ideas? For tips troubleshooting mail sent to AOL, see <http://members.aol.com/adamkb/aol/mailfaq/#receiving>. ...

Help Problem Modifying edit box sting using a thread.
Hello I am programming in MFC ...i have a thread void thread 1() and i want this thread to change the contents of the edit box however even though tha the cstring value is set .. i can modify it everywhere else the value of edit box in my program Except inside the thread :-( it says : 'm_edit' : undeclared identifier. Now a friend recommended me to use the PostThreadMessage (to the thread ID of the main thread) or PostMessage (to the main window) I cant figure out how to use it void thread1( CWnd* pWnd ) { printf ("Thread is rolling"); pWnd->PostMessage(m_edit,...

listbox with buttons
Hi! I've wrote ownerdraw listbox class, derived from CListbox, which has 3 buttons on every item. The problem is that the whole component is flickering while scrolling when there's, let's say, over 20 items. I suspect the reason is that every button gets WM_PAINT when listbox is scrolled but I don't know the solution how to prevent it from flickering. Maybe I should use double buffering somehow, but this method is connected with painting on DC not creating windows.. thanks for any help Marcin mati wrote: > Hi! > > I've wrote ownerdraw listbox class...

Problem with Displaying of images when minimized & maximized
Hi all, In my application I am displaying some images in Taskbar at the bottom of the dialog The problem is......... when i change the tab & minimize the dialog & maximize it.... the images are not getting displayed in the taskbar.... I am using RedrawWindow() function to redraw the images......this problem comes in Win XP2 version only... In all other OS's it is working fine..... please help... thanks in advance, krish ...

Problem with Published Customizations
We have CRM 1.0 and, for the most part it works great. We have some jscript added to 2 of the onchange events which usually works fine. And all of our user logons usually work fine. However, when we make any customizations, even as simple as moving a field up a row on a form, then publish the change, AND reset IIS, we run into problems: ALL Logons that are not System Admins cannot "browse" thru CRM AND the jscript program quits working. After numerous restarts and IIS resets, EVERYTHING works fine again. Can anyone explain? We shouldn't have this problem, should we?...

Mailserver name change problem
Everytime we launch Outlook Express the mailserver is changed to "localhost" and the mailserver name is added to our "user name" like this: "username/mailserver". I change "localhost" to the actual mailserver name on the "Incoming mail (POP3)" line and I change "username/mailserver" to "username". Then I click on "apply" and "OK" and close out all other dialog boxes. When I click on the "Send/Receive" button on the top of the Outlook Express window, it then allows me to receive all e...

Inconsistent rule problem
I have a rule set up that automatically forwards specific emails as an attachment. The problem is that sometimes an email will come in the rule will send it off and then the email is marked as read, at other times it's marked as unread. Is there anyway to make sure that the email will read unread until I actually read it? -- ejames See my reply to your post in microsoft.public.outlook.general. -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please reply only to the newsgroup to preserve the message thread. *** "ejames"...

Outlook Shortcut problem
Oddest thing occured. The main shortcuts on the bottom left of Outlook 2002 no longer point to the appropriate folders. Even using the "Go" shortcuts do not work. I can access the folders going through "today" then click on those links. I researched a bit regarding this but came up empty. The last resort is reinstalling however that doesn't really tell me why or how to appropriately fix it. Any ideas? thank you So is it the Outlook Bar that's corrupted? Try starting Outlook once with the /ResetOutlookBar switch. If you need help using Outlook comma...

PipeStream (NamedPipe) Read existing Pipe Problem with EndRead/ no timeout
Hi Please help me with System.IO.Pipes; i use this.pipe = new NamedPipeClientStream(".", "S036X", PipeDirection.InOut, PipeOptions.Asynchronous); pipe.Connect(200); to connect an existing Pipe which is provided by an 3rd party Application. Connecting, Writing and reading the pipe works mostly fine. But !! sometimes reading the Pipe blocks my App. I think it happend when the pipe is empty (i can force it reading the pipe right after pipe.Connect(), without sending a command to the pipe- Server) is there a possibility to find out whether data pres...

Problem sending large files
Hi I'm running Win XP Home on a P4 3.2ghz / 1.5GHZ 400mhz RAM/ Outlook 2003 SP2 and I'm having problems sending a 43MB file. (MPEG) It sits "sending" in my outbox for hours. I'm on a 2.2Mbps Broadband connection with no limits in/out for the file size. If I send a smaller 1-2MB file it goes in seconds. Any ideas? Nik. "Nik" <nik.walmsleySPAMKILL@btinternet.com> wrote in message news:dov0j6$92u$1@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com... > Hi > > I'm running Win XP Home on a P4 3.2ghz / 1.5GHZ 400mhz RAM/ Outlook 2003 > SP2 and I&...

Problem solved
Hello, at first I want to thank you for the answers. I mentioned in my first posting that I need something like a redirection of messages to another class. I found the solution and made it like this: I call SetWindowLong with the handle to the window that normally receives the messages and gave another fn (a replacement) for the WindowProc (which is located in the other class) to the routine. m_pWndProcOld = (WNDPROC)::SetWindowLong(CCaptionButton::m_hWndCap , GWL_WNDPROC, (DWORD)CCaptionButton::HookedWindowProc) -- regards Thomas cobuser at gmx dot de cobuser at aol dot com --- XCr...

.NET FRAMEWORK v2 INSTALL PROBLEM
When I try to install .Net Framework v2, the error messages below appears: http://cid-b7d840733dbbfdc8.skydrive.live.com/browse.aspx/NET%20FRAMEWORK%20v2%20ERROR%20MESSAGES%20for%20NEWSGROUP Click on an image to see an enlargement. ...

Problem go to native mode Exchange 2000
Try to change to native mode for Exchnage 2000 but can�t decommision last Exchange 5.5 server. Followed the steps from Microsoft Knowledge Base Article - 284148 (http://support.microsoft.com/kb/284148) but can't see the 5.5 server from the Exchange Server 5.5 Administrator connected to exchange 2000 server. Found the follwing on (se below for accepted answer): http://www.experts-exchange.com/Networking/Email_Groupware/Exchange_Server/Q_20478211.html Which seems to be good solution but when presented this manual remove to a consult he said that we could get problem to create a new post...

OWA connection problem #2
I have a SBS2k3 R2 server with one nic behind a hardware firewall. Can anyone tell me which ports to open/forward on the firewall to allow Outlook Web Access? Any and all help appreciated. -- ------------------------------------------------------------------------------- This message has been checked for all known viruses. The information contained in this e-mail and any attachments is confidential and may be the subject of legal, professional or other privilege. It is intended for the named addressee only and may not be disclosed to any other parties without the prior permission o...

Money 2002 Problem with XP Home version
When installing the Money 2002 on my home PC I get the following error. "Unable to initialize a required Money component. Please reinstall Money from your original product disks." I have tried the correction to the registar file with the Checksku.exe. However, money 2002 did not work after. Have you tried any of the other options in http://support.microsoft.com/default.aspx?kbid=313374&Product=mny ? -- Glyn Simpson, Microsoft MVP - Money http://money.mvps.org Check http://money.mvps.org/faq for tips and fixes for MS Money. To send Microsoft your product wishes see http:...

XSLT problem #2
Hi! I'm new around xml and xslt... I'm trying to write a dataset to a CSV file. I'm doing like this: I'm creating a Stylesheet: writer is a XmlTextWriter. (...) // xsl-template writer.WriteStartElement("xsl:template"); writer.WriteAttributeString("match","/"); // xsl:value-of for headers for(int i=0; i< sHeaders.Length; i++) { writer.WriteStartElement("xsl:value-of"); writer.WriteAttributeString("select", "'" + sHeaders[i] + "'"); writer.WriteEndElement( ); // xsl:value-of if (i != sFileds....

Account register sorting problem
Hi. I searched this group via Google Groups and did not find an answer to my question. In Microsoft Money 2004 Small Business, I set my checking account register to "Sort by date" and "Sort Decreasing". That part works; however, the bottom (oldest) transaction is automatically selected. I hit Ctrl+Home to select the top transaction. That is fine as long as my Money session is ongoing. When I exit Money and return to the very same register, Money takes me to the bottom transaction again. It annoys me to have to Ctrl-Home in every account register each time I launch Mo...

Cursor Movement Problem
Greetings, I need for the user to be able to hit the enter key and the cursor to jump to the next data entry cell (which is not touching the entry cell where the cursor is now sitting). This is for a single sheet with 114 entry cells. Can someone please show me how this is done or point me in the right direction. TIA -Steve Moulton Steve, Go into the Visual Basic Environment (Alt-F11) and select your sheet in the VBAProject window (if it isn't there, View - Project Explorer). Open the Properties window (View - Properties window), and set property EnableSelection to xlUnlockedC...

Problem with Package Wizard
I'm using the Package Wizard from Access 2003 Developer Extensions to create an install program. I have a question though that I have not been able to figure out. If a user decides to install to a folder other than the default one, I need a way to set that path to the registry. This is because another program launches the Access program and needs a way to find it. I've written install packages before and have always used the [TARGETDIR] variable to set a registry variable to the application folder. But the values I'm getting when I do this are incorrect. [TARGETDIR] always...