how MFC uses hash table to cache message

hi,
i want to find out how MFC uses hash table to cache message,
then i read the CWnd::OnWndMsg.
and the following:
const AFX_MSGMAP* pMessageMap; pMessageMap = GetMessageMap();
UINT iHash;
iHash = (LOWORD((DWORD_PTR)pMessageMap) ^ message) & (iHashMax-1);
AfxLockGlobals(CRIT_WINMSGCACHE);
AFX_MSG_CACHE* pMsgCache; pMsgCache = &_afxMsgCache[iHash];

"(LOWORD((DWORD_PTR)pMessageMap) ^ message) & (iHashMax-1)"
is used to generate index. but why "xor" pMessageMap and message?
is it to avoid collision somehow? i don't get it.

thanks,

Ian

0
cfchou (1)
5/12/2005 5:45:41 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
441 Views

Similar Articles

[PageSpeed] 23

Reply:

Similar Artilces:

Macros and reminder screen or message about test company.
I would like to add a macro and run it from the task manager. So far this part is cool. The problem Im having is with pop up windows in GP. For example "reminder" screen automatically pops up when a users logs in. This seems to stop the macro. Are there any suggestion around this screen besides turning off reminder screen from popping up? I did find the article on microsoft referring to using Logging file "macro.log'. This option got me pass the login prompts but this option didnt work either for pops. Thanks for any help, Mar ...

Looking at a message without opening it
Hi there, This is an Outlook question, despite me mentioning Outlook Express below.. In Outlook Express, I can look at a message in raw format (including ALL email headers, mime parts, etc) by right-clicking on the message in the inbox, select "Properties", select "Details" tab, select "Message Source" button. This will open a text window displaying the whole email in raw format. Can I do that with Outlook as well? Right-click, "Options" does not give me the same possibilities like in Outlook Express. But perhaps there is a plugin or makro I cou...

Automate creation of a table of hyperlinks?
I would like to create a simple spreadsheet consisting of a single column, where each entry is a hyperlink to a related image file (located in the same folder as the spreadsheet). It's easy, but laborious, to do the cells one at a time - either with the Hyperlink function or Insert Hyperlink. I can easily generate the list of text entries (just the image file names, to start) with a DOS DIR command to create an importable text file. But haven't been able to figure out how to convert these into Hyperlinks in one fell swoop! - Herb Herb You could try this macro from David McRi...

count cells using multiple criteria
Can anyone show me how to count the number of rows containing two or more criteria? For example, if one column has the text "DO" and another column has the text "RD11" how do I count only those rows that contain both DO and RD11? One way: =SUMPRODUCT(--(A1:A1000="DD"),--(B1:B1000="RD11")) In article <0F41177E-45A0-4B0B-AE33-6BCCF2F3B8D1@microsoft.com>, Alex68 <Alex68@discussions.microsoft.com> wrote: > Can anyone show me how to count the number of rows containing two or more > criteria? For example, if one column has the te...

revised q on report from tables
Hi Would still love help on previous regarding 20 tables but in a panic. :( I have now ref all tables to 1 long list so as a quick fix: the col headings of the list are PC | Name | Rate | B | S |X | L1 In the report sheet I have a drop down list of the PC col. I would like to be able to select the PC and the report be filled with the following data only: | Name | Rate | B | S |X | L1 I have used vlookup and tried to hack an old code that can be copied down but it will only ever show the first record :(:( Sorry for being thick.. Cheers for all help and I ...

errors while trying to send / receive messages thru hotmail (using Outlook 2003)
I use Outlook 2003 I've tried to configure Hotmail on Outlook 2003 I keep getting the following errors while trying to send / receive messages thru hotmail (using Outlook 2003) -------------------------- errors -------------------------- Task 'Hotmail - Sending' reported error (0x800CCC19) : 'A timeout occurred while communicating with the server.' Task 'Hotmail: Folder:Inbox Synchronizing headers.' reported error (0x800CCC19) : 'A timeout occurred while communicating with the server.' --------------------------------------------------------------- ...

Unable to send e-mail and get error message when opening live mail
This is the message I get Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Subject 'pic' Server: 'post.camtel.net' Windows Live Mail Error ID: 0x800CCC0F Protocol: SMTP Port: 25 Secure(SSL): No I call server and all is well. Turn off e-mail scanning in your anti-virus program. It is a redundant layer of protection that eats up CPUs, slows down sending and receiving, and causes a multitude of problems such as time-outs, account setting change...

RMS MS Access Link
I just figured out a way to more easily manage my database items... You can use a linked table in MS access to connect to the SQL server and. Then the table can be edited in a spreadsheet-like view. Generally, you create a new blank database in Access. Then click on Tables. Right click and create a new linked table. Go through the motions to select your SQL database server and select the dbo.Item table. For more detailed information, search google or go to: http://www.frontpagehowto.com/sqlaccess.htm Jason I did made connection with MS Access but had an error when I try to access or ...

Terminating Application using ShellExecute return value
I use MFC Visual C++ 4.2. I have a Main application that runs Child application using ShellExecute. When the Main application terminated, the Child application will also be terminated. I have tried to use the TerminateProcess but I think that's rather rough so I thought of if I can use the ShellExecute return value to terminate the process it ran. Is this possible? If it is not, what application terminate method that is safe? Thank you very much. On Dec 22, 12:08=A0pm, Landon <Lan...@discussions.microsoft.com> wrote: > I use MFC Visual C++ 4.2. > > I have a Main a...

Is there a way to turn off the prompts of a make table query?
I merely want to update the table to be used as an export to Excel using TransferSpreadsheet. Each time it prompts for deleting old records and adding new records. Is there a was to turn off the prompts? Bottom line - I want to create an Macro to export the output of a query to an Excel spreadsheet. BobC, DoCmd.SetWarnings False 'Off Your TransferSpreadsheet line here DoCmd.SetWarnings True 'On -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "...

Change system message
When you have a combo box where you must choose something from a list and the list to list property is set to Yes the message that comes up is "The text you entered isn't an item in the list. Select an item from the list, or enter text that matches one of the listed items" I would like to personalize that message based on the control (this so I can change the message depending on the control - different control different message). Is there a way to do this? Thanks. Sarah, use something like this in the NotInList event for the combobox: Private Sub Combo10_NotInList(Ne...

How do I remove the (blank) from an excel pivot table?
I am trying to create a pivot table from a liston an excel spreadsheet. Many of the items on the list will be blank. On the pivot table, the blank items show up as (blank) - I want the cell to be empty! I tried setting the table empty values but that doesn't work...any help would be greatly apprecated... If you click the small black triangle near the top of the Table, a menu will appear. Just clear the checkbox next to (blank) -- Gary''s Student "MarkfromAZ" wrote: > I am trying to create a pivot table from a liston an excel spreadsheet. Many > of the...

how do i create an html email using word
MY company would like a simple Word html newletter email that can be updated by various subsidaries. Ideally we'd like to "lock" formatting and some graphics and have editible regions. Any Help? Word is a poor html creation application. I doubt that Word's implementation will enable you to provide the elements you require - however set the web view to view the formatting and save as a web page.Better still use a proper html creation tool to create the page or create it as an attachment as a Word document form or (if you have the full version of Acrobat) a p...

Using mathmatical functions on ranges that have #NA
I need to take the median of a column of data, but some of the cells in my intended range have the #NA or #Value error. When you try to use the functions with data cells that have error values, the result is an error value. I can't filter the rows of data because I need to have visibility to the information in other columns. median(a1:a5) = #NA A1 5 A2 6 A3 7 A4 8 A5 #NA Thanks I Mike, =Median(IF(ISNUMBER(A1:A5)=TRUE,A1:A5)) array entered (ctrl+shift+enter) Formula will appear in "{ }" HTH PC "mike" <mar@kurtasalmon.com> wrote in message news:008...

cannot send e-mails using windows mail
I cannot send e-mails using my Windows e-mail. I think I have probably set it up incorrectly. How can I reset it so that I can use it? Thanks Glenn What happens when you try? Any error message? Please post the error message in its entirety. You can left click on it to highlight and then right click to copy and then paste it into this thread. -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "glenn" <glenn@discussions.microsoft.com> wrote in message news:DD0CE029-59E6-48E0-AF1F-6847C8D8B83A@microsoft.com... >I cannot send e-mai...

using a picture as a stacked bar in chart
I am wondering how to use a picture (a barrel or a glass) instead of the bar in a stacked bar chart. So rather than have a stacked bar with 4 colors I would have a picture of a glass with the 4 colors. Is this possible? and if so how can I do this? I've seen it in other presentations, but I don't know if it used other applications to create. Thanks Hi, You can use a picture as the fill picture. You will need 4 images to get different coloured glasses. Double click a series. On the Pattern Tab click Fill Effects. On the Picture tab use Select Picture. For xl2007 the Picture...

Shading text using keyboard shortcuts
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I am editing formatted text. I want to be able to select words and shade them yellow, green, no shade, etc. without changing the formatting (bold, italics) - and do this entirely using customized keyboard shortcuts and the shift and arrow keys (that is, no mouse). How can I do this? <br><br>Thanks, <br> - Steve Use Control+U to edit content in the cell. You can then use the arrow keys to navigate left & right. Shift+Control+L/R Arrow selects by word but you're on your own as far as se...

Pivot Table -- Text??
I don't think this is possible, but thought I'd check to be sure. Can a pivot table display text values or must a pivot table do calculations and only display numbers?? I am basically trying to create a report from data I pulled from MS Project... I've got a resource name, a list of dates, and a list of projects. I'm looking for a solution to the cross tab report "who does what when." I want to create a pivot table that will display the dates as columns, and the resource names as rows... and then in the data section the project name. I want it to look somethin...

Unable to display folder error message--HELP
Since having Windows XP reinstalled last week, I have a new problem with Outlook 2002. I've used Outlook for several months for contacts and calendar, which I hotsync with a Palm. I do not use Outlook for email, as I use Netscape. I am not on a network. This is the problem. Both the Calendar and Contacts work fine for awhile and then I get the following message when I either click on Calendar or Contacts: C:\Documents & Settings\username\Local Setting\Application Data\Microsoft\Outlook\Outlook.pst is already in use by the maximum number of applications. Close some of these app...

List of where queries are used?
I have an access database which has many queries which are leftover from various tests and temporary data extract needs. Is there a tool which can tell me which queries are used in all reports, queries, macros, or modules in the database? Hi Joseph, You might want to take a look at the Total Access Analyzer (< http://www.fmsinc.com/MicrosoftAccess/BestPractices.html>). Or you can use Access's own Documenter. Run it on all the objects in Access with maximum reporting settings, and then export/save it to a file of some sort that can be searched (text, PDF, Wo...

copy and use vba code
Hi, I am relatively new to using vba. I have successfully recorded and used macros, and also have created simple procedures in vba to use as a macro. What I am trying to do now is copy and use vba code in excel and am having trouble. The situation is this: I found vba code in these forums that I would like to use. What I did was copy the code into a module in the VBAProject (Personal.XLS), where all my aforementioned macros are located. However, when I attempt to find the macro via the Tools>Macro>Macros menu item, it is not listed (all the other macros are). I then tried a new ...

integration manager error: Scrolling window link table not on form
We've had this integration running for the last couple of years and today it stopped. I get this error: "DOC 1 ERROR: Scrolling window link table not on form." regardless of whether I run it on new or processed data. I think this causes the balance of the documents to fail. Here is the full log. Integration Log Integration: AR Sale Invoice Upload (ID: 41) Action: None Start Time: 8/16/2006 12:40:03 PM 8/16/2006 12:40:03 PM Source: IIntegrationEngine_Run, Status Code: 0 Opening source query... 8/16/2006 12:40:03 PM Source: IIntegrationEngine_Run, Status Code: 0 ...

Embedding a standalone MFC Application into an ActiveX Control
Is there a tutorial out there or a standard method used to convert a MFC application (.exe) into a ActiveX Control? First I'm attempting to port over a simple notepad mfc application to get an idea of what to do. > Is there a tutorial out there or a standard method used to convert a > MFC application (.exe) into a ActiveX Control? > > First I'm attempting to port over a simple notepad mfc application to > get an idea of what to do. An activeX control supports certain interfaces. For you to convert your app, you have to decide what it means to you. It does not make mu...

Do you use design patterns?
Just wanted to see how many people know the patterns in this book(http://search.barnesandnoble.com/Design-Patterns/Erich-Gamma/e/9780201633610/?itm=2) by heart, and how many have actually used a known pattern more than once? AliR. AliR (VC++ MVP) wrote: > Just wanted to see how many people know the patterns in this > book(http://search.barnesandnoble.com/Design-Patterns/Erich-Gamma/e/9780201633610/?itm=2) > by heart, and how many have actually used a known pattern more than once? > > AliR. This dust-collector has been sitting on my shelf for years. :) I believe many o...

Disabling the 'From' option within New Message #2
Is there a way to disable the 'From' option on the Options drop-down on the new message. I was looking at this yesterday. I was able to select a user's email address other than my own to be the sender. Where can this be disabled? Outlook 2003/Exchange2003 Thanks in advance ...