From: SMTP%"goossens@epc.be" 22-NOV-1997 09:55:19.27 To: , "Mehrshad Setayesh" CC: Subj: Re: [ntdev] Using Sleep to suspend exectution of a primary thread Return-Path: owner-ntdev@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Sat, 22 Nov 1997 09:54:12 -0500 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id AAA19084 for ; Sat, 22 Nov 1997 00:53:16 -0500 (EST) Received: by gw.atria.com id Fri, 21 Nov 1997 21:00:43 -0500 Received: from ng.netgate.net by gw.atria.com id Fri, 21 Nov 1997 21:00:40 -0500 Received: from dragon.agatetech.com (d18.netgate.net [205.214.160.50]) by ng.netgate.net (8.8.5/8.8.5) with SMTP id SAA07427 for ; Fri, 21 Nov 1997 18:02:56 -0800 (PST) Received: from [127.0.0.1] by dragon.agatetech.com (NTMail 3.02.13) with ESMTP id oa005682 for ; Fri, 21 Nov 1997 15:03:44 +0000 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by ng.netgate.net (8.8.5/8.8.5) with SMTP id OAA22106 for ; Fri, 21 Nov 1997 14:19:21 -0800 (PST) Received: by gw.atria.com id Fri, 21 Nov 1997 11:01:04 -0500 Received: from ng.netgate.net by gw.atria.com id Fri, 21 Nov 1997 11:00:56 -0500 Received: from dragon.agatetech.com (d5.netgate.net [205.214.160.37]) by ng.netgate.net (8.8.5/8.8.5) with SMTP id IAA25525 for ; Fri, 21 Nov 1997 08:03:27 -0800 (PST) Received: from [127.0.0.1] by dragon.agatetech.com (NTMail 3.02.13) with ESMTP id fa005647 for ; Fri, 21 Nov 1997 06:01:16 +0000 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by ng.netgate.net (8.8.5/8.8.5) with SMTP id FAA18673 for ; Fri, 21 Nov 1997 05:59:04 -0800 (PST) Received: by gw.atria.com id Fri, 21 Nov 1997 02:24:39 -0500 Received: from mailgate.arcadis.be by gw.atria.com id Fri, 21 Nov 1997 02:24:34 -0500 Received: from vgopc (dialin-7-71.online.be [195.38.7.71]) by mailgate.arcadis.be (8.8.5/8.8.5/1997041001) with ESMTP id IAA14017; Fri, 21 Nov 1997 08:15:53 +0100 (MET) Message-Id: <199711210715.IAA14017@mailgate.arcadis.be> From: "Vincent Goossens" To: , "Mehrshad Setayesh" Subject: Re: [ntdev] Using Sleep to suspend exectution of a primary thread Date: Fri, 21 Nov 1997 08:22:47 +0100 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1161 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-UIDL: a1a457bdb35718c0ccd5adaf87b41beb Sender: owner-ntdev@atria.com Precedence: bulk If you suspend the thread, you suspend the handling of the thread message queue. This means that you queue the 3 messages corresponding to AddString and do not process them until you give hand back to the message loop. In pure SDK, you would have to set a timer, MsgWaitForSingleObject( timer) and handle all incoming messages (while(PeekMessage()). I don't know the way to do that with MFC. Vincent Goossens goossens@epc.be European Peripheral Corp. ---------- > From: Mehrshad Setayesh > To: ntdev@atria.com > Subject: [ntdev] Using Sleep to suspend exectution of a primary thread > Date: Thursday, November 20, 1997 11:13 PM > > Hi everyone: > > I am developing a simulator application through Visual C++ 4.0 IDE. In > this process I need to add several strings to the list of a combo box. The > strings are to be added with some period of time elapsing between each > addition. I decided to use Sleep function after each addition. However I > do not get the expected results. User does not see string1 being added and > after a while string2 being added and so on. What they see is a period of > time elapsing and then all the strings are added and displayed at once. > The code to add these strings is as follows: > > ////////////////////////// Start of code > m_myBox.AddString ("String1"); > Sleep (1000); > m_myBox.AddString ("String2"); > Sleep (1000); > m_myBox.AddString ("String3"); > ////////////////////////// End of code > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]