when to call DispatchMessage

Hi,

if I handle an event in an event loop do I still need to call
DispatchMessage afterwards? or is it only for the messages I don't
handle?

0
12/2/2005 11:06:11 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
488 Views

Similar Articles

[PageSpeed] 44

It's only for message that you don't want any further processing done on. 
That said, this is an MFC newsgroup. It's is very rare to implement your own 
"event loop" in an MFC application. Makes me think I may not really 
understand what it is you are doing.

-- 
Jonathan Wood
SoftCircuits
http://www.softcircuits.com
Available for consulting: http://www.softcircuits.com/jwood/resume.htm

"alexl" <alextheblade@gmail.com> wrote in message 
news:1133564771.457371.306350@f14g2000cwb.googlegroups.com...
> Hi,
>
> if I handle an event in an event loop do I still need to call
> DispatchMessage afterwards? or is it only for the messages I don't
> handle?
> 


0
jwood (1292)
12/2/2005 11:08:31 PM
I was using AfxBeginThread and putting a message loop in the
controlling function passed to AfxBeginThread.

Per
http://www.codeguru.com/Cpp/COM-Tech/activex/apts/article.php/c5533/
scroll to
Rule 2: STA Threads Need Message Loops



Jonathan Wood wrote:
> It's only for message that you don't want any further processing done on.
> That said, this is an MFC newsgroup. It's is very rare to implement your own
> "event loop" in an MFC application. Makes me think I may not really
> understand what it is you are doing.
>
> --
> Jonathan Wood
> SoftCircuits
> http://www.softcircuits.com
> Available for consulting: http://www.softcircuits.com/jwood/resume.htm
>
> "alexl" <alextheblade@gmail.com> wrote in message
> news:1133564771.457371.306350@f14g2000cwb.googlegroups.com...
> > Hi,
> >
> > if I handle an event in an event loop do I still need to call
> > DispatchMessage afterwards? or is it only for the messages I don't
> > handle?
> >

0
12/4/2005 1:29:43 AM
Reply:

Similar Artilces:

help with code on event call
Hi I am unsure how to code the following the table I am working on is Baan I am selecting the record using the orderNo field but depending if the field IcyDate empty or not I will open different forms the code I have in the event call at the moment is below and where I have put the ***** is where I need an if statement to see if the field IcyDate is empty or not Private Sub But_SelONo_Click() On Error GoTo Err_But_SelONo_Click Dim stDocName As String Dim stLinkCriteria As String Dim intcount As Integer intcount = DLookup("[Count-O-N]", "[Qu-cmm-countor...

C++ calling vb6 dll which calls another vb6 dll
I am having problems with a C++ project I am working on. I am trying to call a vb6 dll which in turn calls another vb6 dll. Now I can call some methods in the first vb6 dll fine, but when i call the method which then calls the other vb6 dll, c++ just hangs. No errors are raised, nothing, it just sits there doing nothing. The c++ project is itself a DLL. I have created a simple vb6 exe program to call the exact same vb6 dll and it works fine. Also i have created a c++ win32 exe to call the vb6 dll and that also works fine. Can anybody help? Kind Regards, Matt > I am having problems w...

calling up a workbook
In my macro I do a 'save as', in which the program calls for the 'save as' by a variable (called 'stage_name'). I save the sheet - don't close it - go on with another sheet and do another save as (by a variable 'stage_order'). Now I want to activate the workbook stage_name. It doesn't work what am I doing wrong? Here is what my macro looks like : 'prompt for a save as.... Do OrderFormName = Application.GetSaveAsFilename(InitialFileName:="Sales Order_Rep Name", _ fileFilter:="Microsoft Excel (*.xls), *.xls") ...

PHONE CALLS
Hi, If I have phone calls scheduled within MS CRM web client how do I see what time they are scheduled for, in addition to the date? When a phone call is scheduled you can put what time it is due at. However, in my activities I cannot see what time it is due at. Best regards Lee You might be better off using appointments to schedule conference calls. They will appear on your calendar then. I think the phone call activity type is better used on spur-of-the-moment phone calls... just my opinion. Good luck! >-----Original Message----- >Hi, > >If I have phone calls scheduled...

Calling a .NET created DLL from an MFC/Win32 Application?
We currently have a legacy MFC/Win32 based application that does a lot of GDI rendering. What I would like to be able to do is embed an Expression Blend ( http://www.microsoft.com/products/expression/en/expression-blend/try.mspx ) composition within our application and dynamically control the properties of the rendering through the wrapping app. E.g. The Expression Blend composition is showing a red car rotating and the user chooses blue from our app, I'd like to dynamically change the render to blue. MS's Expression Blend utilizes XAML and the new Windows Presentation Founda...

Counting the number of times someone called in sick
How do I count the number of times a person has called in sick? 9/1/05 work 9/2/05 work 9/3/05 sick 9/4/05 sick 9/5/05 work 9/6/05 sick The above example shows the person called in sick 2 times for 3 days. How do I create a formula that reflects this? thanks Use the COUNTIF function. Something like =COUNTIF(B1:B100,"sick") -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "smskater" <Smskater@gmail.com> wrote in message news:1126825921.212344.21180@g44g2000cwa.googlegroups.com... > How do I count th...

Altering data that was called with LOOKUP
Hi, I have a list of data approx 9000 lines long (32 columns), and have a seperate sheet that allows a user to input a code. This then retrieves their data item using vlookup(). I would like to let the user then amend the contents of one of the fields, thus updating the original data list. Is this possible? thanks -- Lynxbci3 ------------------------------------------------------------------------ Lynxbci3's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=10377 View this thread: http://www.excelforum.com/showthread.php?threadid=487545 It could be possible, ...

Call Center Software
We have a fairly large call center (350+) taking tech support calls (100k/month) 7x24x365. Most of our customers have support contracts with us with a few that don't. We have created a customized solution that will take the contract and billing information and (through the use of eConnect) bring that information over to GP. It works for the most part but instead of having to continue investing more into custom development, we are looking for an out-of-the-box solution that would be integrated with GP 10. Key functionality would include call/case mgmt, contract mgmt and recurring...

Problem calling unmanaged DLL from VB.NET
I've been bashing my head up against a brick wall for 4 days, and I've reached the limit of my frustration and knowledge. I'd appreciate some ideas on what I'm doing wrong. I have a simple Visual Basic Express 2008 program. It calls a DLL (supplied by others). Calls to the DLL in small (trivial) programs work fine. When the program grows in size I get a "vshost.exe has stopped working" message. It happens when I call any dll function that tries to return a string. I have googled and tried everything. The full program is a few thousand lines, much of ...

"Error 49: Bad DLL Calling Convention"
MS Access has started throwing this error at the exit point of one of my routines. /Decompile followed with a compact/repair makes it go away; but what's got me worried is that it's come back twice over the past weeks - for total of 3 appearances. I also am pretty sure I've been through this a couple of times in years past. Googling, most of what I see is in the spirit of Jeffery MacLeod's post to microsoft.public.access.modulesdaovba in the " Possible answer to Err 49: Bad DLL calling convention" thread: --------------------------------------------------------- T...

Covered Call Options
Hello all, I do I go about dealing with a covered call transaction in Microsoft Money 2007 Premium? Currently what I am doing is inputing the option symbol, and choosing the transaction "Sell to Open" then when I go to expire the option I try to do a Sell to Close. However it does not seem to work? Also what happens if instead of expired I has the position assigned? how would I account for that? Thank you. Shhhh In microsoft.public.money, Shhhh wrote: > >I do I go about dealing with a covered call transaction in Microsoft >Money 2007 Premium? Currently what I am doing is...

Call Paste function with Undo
Is there any way to call the Paste function using a macro code and with the undo capability still intact. Everything I have tried the undo is not available after the Paste. Thank you, Steven hi a macro skips all of the built in niceities that excel has. undo is one of them. see this site. http://spreadsheetpage.com/index.php/site/tip/undoing_a_vba_subroutine/ Regards FSt1 "Steven" wrote: > Is there any way to call the Paste function using a macro code and with the > undo capability still intact. Everything I have tried the undo is not > av...

Calling an external javascript
My onLoad event is getting very big. I was wondering can I call an external file with the javacsript code in it? How can I do this? Regards, Stella Hi Stella, Yes, you can include your Javascript code in a separate file and include this in the onLoad event. Mitch Milam's post here (http://blogs.infinite-x.net/2006/02/18/including-custom-javascript-files-in-mscrm-30/) details the approach. HTH, Niths "stella7113" wrote: > My onLoad event is getting very big. > > I was wondering can I call an external file with the javacsript code > in it? How can I do this?...

Calling Webservice over HTTPS from Winform
Anyone know some information about this. Any article or something like that How does this work with the certificates. From web you will be prompted with something like a "trust server"-message. How will this work when calling from Winform? Is it possible to prevent or hide this message Will WSE encryption technique give better performance than using HTTPS. Will it reduse roundtrips for every call ...

calling unmanaged code in Win32 API
Hi! When I looked in the doc for the Win32 API CreateCompatibleBitmap I saw these two Library Gdi32.lib DLL Gdi32.dll I know what a DLL is because that's what I use when callingWin32 API from managed code but what is the Gdi32.lib ? //Tony Hi Tony, Tony Johansson wrote on 29.04.10 in microsoft.public.dotnet.languages.csharp > When I looked in the doc for the Win32 API CreateCompatibleBitmap I saw > these two > Library Gdi32.lib > DLL Gdi32.dll > I know what a DLL is because that's what I use when callingWin32 API from > man...

Call or Send SMS to any phone anywhere in the world Free! -
Call or Send SMS to any phone anywhere in the world Free! - http://offr.biz/HLGB7239092DDEBCYL ...

Change default duration on phone calls
How would I change the default duration on phone calls? It's on 30mins and I want it to be 5mins. Thanks I would try to use the MSCRM SDK for Client - JScript to default this value: http://msdn.microsoft.com/en-us/library/cc150836.aspx Good luck. Frank Lee, Microsoft Dynamics CRM MVP http://www.workopia.com/Links.htm http://microsoft-crm.spaces.live.com "John" wrote: > How would I change the default duration on phone calls? It's on 30mins and I > want it to be 5mins. > > Thanks Hi John, Just want to let you know the actual duration minute field is a...

win CE6.0 's KernelIoControl calling in VC program
Hi, My system is ARM9 + CE6.0. Some KernelIOControl are developed with my BSP, and they can be called correctly in drivers. But these KernelIoControl return FALSE when called in subprojects or VC prgram. Thanks for any suggestions. The Same KernelIOControl APIs work fine in CE5.0 based system. The following are the code in VC #define IOCTL_KLIB_USER 256 // where OEM defined IOCTL starts. #define HAL_EM9XXX_BUILT_STAMP_READ 117 #define IOCTL_EM9XXX_BUILT_STAMP_READ CTL_CODE(FILE_DEVICE_HAL, IOCTL_KLIB_USER + HAL_EM9XXX_BUILT_STAMP_READ, METHOD_BUFF...

To call WebBrowser in a macro
We are working on Excel code to make structured Contact records. It would be useful to open a WebBrowser window for source text I have not yet found suitable sample text for VBA and VBE under XP 2003. One way might be to invoke a New Web Query - is there any code to do that? Ross Wilcock arwilcock@sympatico.ca ...

Sockets : Recv calls just hanging
I've been using CESockets and the Winsock APIs (CE doesn't do Asynchronous sockets btw). A thread that I've got reading the receive buffer calls recv() and the box just freezes until data appears.. it seems to lock every thread in the App. Here's where I connect if (connect(socket, (sockaddr*)&sin, sizeof(sockaddr_in)) == SOCKET_ERROR) Here's where I call receive iBytesRet = recv(pT->socket , (char*)buffer , iBuffSize , 0 ); There's no thread synchronisation issues (nothing else will be accessing the socket) that I can think of. Thanks You should check to...

Can not make Messenger video calls
When I try to make a video call, I get the following message: Messenger is not available right now. Please try again later. (0x8ac70013) The video feature has worked in the past, the problem appeared after the forced upgrade to the latest version of Messenger. I am running Windows 7 I don't have McAfee Site Advisor installed I don't have WMware installed I opened a case with Microsoft Support (SRX1118889786ID) , sent various logs as requested, was told well over a month ago that it will be escalated to a specialist, heard nothing to date. Any assistance to resolv...

Database template for Collection Call Log
Looking for a database or excell template, for a collection call log. We have a clerk, who does hundred of collections calls, with many differant followup notes. currently uses her outlook calander to schedule call backs and other information. A database would be able to record everything. Also it could allow linking to a customer master file (excel file ) and a current invoice data file sorted by customer. Thanks Arlee Hoecherl Email.. Taxman999@hotmail.com ...

Calling the Row Number?
I'm using the following function: =HLOOKUP("350305",PIVOT,2,FALSE) When I try to copy it down a column, the function doesn't change a all, but I want the number "2" to reflect what row the function is on Is this possible without making another column with number 1,2,3...etc -- Message posted from http://www.ExcelForum.com Use ROW(2:2) instead of 2 -- Regards, Peo Sjoblom "gorkyness >" <<gorkyness.15hljq@excelforum-nospam.com> wrote in message news:gorkyness.15hljq@excelforum-nospam.com... > I'm using the following function: ...

Calling type library dll NOT from project directory
Hi, everybody I have to implement some SDK in my MFC project. I've added corresponding library to the project and copied corresponding dll file to my project directory. But this doesn't work because this SDK was created the way that this dll cannot be copied anywhere, but it must be called from the directory where SDK setup put it. Import directive doesn't work I'm getting an error: "Cannot open type library file:..." So is it possible to indicate (spedify) somehow in my project the path to this dll, unless it's residing not in project directory? Thank to ev...

5 Invalid Procedure Call or Argument
Hi, I have some VBA code that scans through some remote servers and reads backup logs. It works well, except when it scans one particular server, then I get the following error: 5 Invalid Procedure Call or Argument It does not ask me if I want to debug the code so I have no idea what is causing this. To make matters worse, I hardcoded the server that has this problem so that the VBA code only processes this server (but does it many times over). If I run it via the debuging window and step through the code, press F8 it processes this server over and over perfectly. If I run the code...