Problem with menu in dialog box

I have created a dialog box with a menu.
Works fine, *except* that I am unable to update the menu commands:
the OnUpdatexxx(CCmdUI* pCmdUI) handlers do not get called when the menu
opens, however, they do get called when you click the menu item xxx, after
which the xxx command handler gets called too... When this happens, the
m_pMenu member of pCmdUI is null, and calling say pCmdUI->SetCheck() or
pCmdUI->Enable(FALSE) has no effect whatsoever.
Does anyone know how to fix this problem?
Thanks, Werner


0
wfrei (3)
7/5/2003 9:52:04 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
643 Views

Similar Articles

[PageSpeed] 58

On Sat, 5 Jul 2003 14:52:04 -0700, Werner Frei wrote:

>Does anyone know how to fix this problem?

The code to correctly handle menu updates originates in CFrameWnd. But
CDialog derives from CWnd, NOT CFrameWnd.

You can either copy the code to launch the update from the CFrameWnd
sources, or roll your own update mechanism using the WM_INITMENUPOPUP
message.


-- 
Bob Moore [WinSDK MVP]
http://www.mooremvp.freeserve.co.uk/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
bobm (116)
7/5/2003 10:40:51 PM
On Sat, 5 Jul 2003 14:52:04 -0700, Werner Frei wrote:

>I have created a dialog box with a menu.

As a follow up to my last message, there is explanation and Microsoft
sample code here (caution, URL may wrap):

http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b242577

-- 
Bob Moore [WinSDK MVP]
http://www.mooremvp.freeserve.co.uk/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
bobm (116)
7/5/2003 10:43:52 PM
Reply:

Similar Artilces:

Here is fix for Windows file problems
If you have installed a Windows update and started having problems opening, closing, copying files, see: http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.excel.misc&mid=1fe358b1-c8eb-4217-ad2a-4b9fcf741916 A better solution is offered at http://support.microsoft.com/kb/918165 "Problems in Windows Explorer or the Windows shell after you install security update MS06-015". Patricia Shannon wrote: > If you have installed a Windows update and started having problems opening, > closing, copying files, see: > > http://ww...

Problem with CFTPConnection
Hi I've an application that connects to an FTP Server and uploads a big directory (size over 500 MB). Now what happens is that after sometime the application stops uploading files and stays idle. The FTP server connection timeout value is set to 2 minutes. So the server seeing the connection idle for two seconds, disconnect the session and no more file is uploaded. On debugging I found out that after some time CFTPConnection.PutFile() method hangs on some random file and stays like that for 5 minutes (default send timeout value of CFTPSession). During this time the server connection timeo...

Fax Icon on my File menu and toolbar
I had a Fax Icon on my toolbar and also on the file menu. All of a sudden it is gone and I want it back. Where did it go? Was it a dedicated toolbar? Or was it just icons on a builtin toolbar? If it was a dedicated toolbar, you may get lucky and find it under: Tools|customize|toolbars tab (just not selected) But if it was on a builtin toolbar (along with the file menu), then maybe you reset your toolbar--also under: Tools|customize|toolbars tab selecting a toolbar and hitting the reset button. If that's what happened, I think I might try to find the Fax addin/workbook that added t...

Excel 97 Win XP calc problem?
I have a machine running office 97 and Win XP. I have seen posts stating it runs fine, but I don't know how man people use spreadsheets that require a hard calculation: Excel will not force a calculation. i.e. ctrl-alt-f9 does not cause full workbook calculation as required. Meaning cells do not update and it doesn't calculate unless you clic in the cell to edit and hit enter. neither does the "Calc Now" button. Auto or manual calculation mode has no effect. Anybody else have this problem -- Message posted from http://www.ExcelForum.com Make sure that both the SR1 a...

CRM Outlook Client Configuration Wizard Problem
CRM 4.0 - Microsoft Outlook Client Guys, We've Microsoft CRM 4.0 Server roll up 8 as well as CRM Outlook Client on the same roll up version. Our Internal Web Access works without problems users get to it and they're automatically authenticated. IFD Development is the same way except they're prompt through a login page for their username and password when they're coming from an external network. Ever since we moved to a new facility users are experiencing problems connecting to CRM using their outlook client, I have a test machine where I have the CRM Outlook Client ins...

Problem with Update function of CRecordSet class
Hi All When I use from Update function of CRecordSet class, it apply to table after a few time(for example 1 second) when I need to see it at time. Thanks ...

How do I copy the result of a check box into another check box?
I'm trying to copy the result of a "check box form field" into another check box. For example: if I check (or uncheck) one box in a form, another box later in the protected form will also be checked (or unchecked) , much like the ref + F9 command for the text form field. Is this possible? Thanks. This cannot be done without macros. If your project will allow macros - see http://word.mvps.org/faqs/tblsfldsfms/ExclusiveFmFldChbxs.htm -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> G...

can I snap wrap points to a text box
rather than having to add individual wrap points to the edge of a frame, which is never as accurate anyway, can they be set to 'snap' to a frame (eg the ellipse) so that they are perfectly inline, (and which would of course be a lot quicker)? Edit points will not snap. There are options for edit points, select a point, right click. If you hold down control, the cursor will turn into an x, you can delete a point with a click. Truly a good draw program would be preferable. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com &q...

OL2002 Problem : HELP, SOS, MAYDAY
Hi, I have an IMAP account and OL2002 as client. I have checked for my account ( tools, send/receive settings, define send/receive groups, <my_account>, edit) download item description only. It works only the first time I start OL2002, but it does not work anymore for subsequent automatic/manual send/receive operations. Please could someone really help me ? Thank you in advance, Patrick ...

context Menu
Hello I have a Inherited Text Box I have Created a ContextMenu() for the class Now when i Use the Text box in the Code I can Add items to the Context Menu When i Show the form and Textboxes all is fine even when i right click the text box and i do see my option.... The Problem i having is i have 6 Textboxes Representiong 6 Different Physical Drive or unc Paths on the network so when im in the ContextMenu Event , I Cant See which TextBox Control owns this specific Context Menu Any Help thank you On Feb 9, 2:47=A0pm, "msnews.microsoft.com" <dvs_...@...

request to solve my problem #5
hello friends this is vijay,i got a problem while doing my project based on vc++ (i.e)"How to implement Fit Window feature in VC++6.0 in an MDI Application" if any of you got any idea about that please do reply me with the proceedure.i will be waiting for your reply bye with regards vijayprasadreddy ...

Problem with macro assigned to custom toolbar button
Problem with macro assigned to custom toolbar button I am having a probelm with macros assigned to a custom button on custom button. I am using excel 2000. 1. I have created a macro called "Jump" in a workbook named "Test1" 2. I then created a custom toolbar and added a custom toolbar button t that toolbar. 3. Through the customize dialog box I assign the Macro "Jump" to th custom button. Everything works fine UNTIL. If I do a SAVE AS for the workbook "Test1" and call it something els like "Test2" and then close "Test2" an...

Excel. I am having a problem with hidden text
As I type text in some cells, it does not always dispaly if it exceeds the cell length. I wish to keep the cell lenghts for the entire document, but do wish for teh text in that particular row to be displayed. How about if you select that cell, then format|cells|alignment tab|check wrap text And with that row selected format|row|autofit SHR77 wrote: > > As I type text in some cells, it does not always dispaly if it exceeds the > cell length. I wish to keep the cell lenghts for the entire document, but do > wish for teh text in that particular row to be displayed. -- Da...

Refreshing list boxes
Hi, I have created a database so that mulpile users can add detailss to the table - tblDetails from the form frmDetails or amend details in form frmAmend. I have a list box on the main page frmMain which has a list box lstSearch which shows all the records in the database. When users add new record to the database other users cannot see the added records unless the move to another section in the datbase and the return to the main page thus refreshing the list box. Can anyone tell me if there is a way I can put a "Refresh" button on the main page that updated the list box if the use...

Excel List Sorting Problem (Descending)
Hi there, I'm having trouble sorting my list--my column contains *only* 4-digit numbers but when I click on "descending order", only about the first half of the rows are arranged this way, before it begins again to arrange the rest in descending order. Like this: 5120 5119 5118 4000 3050 5116 4112 etc. Has this problem happened for anybody else? I'd appreciate any help you can offer. Part of your list is text, although it looks like numbers. Format an empty cell as number. Enter the number 1. Copy. Select your "numbers". Edit>Paste Special, check Mul...

I really need help with a formview problem
I have a formview that I place a toolbar onto. In my OnInitialUpdate(), after I create the toolbar, I say GetParentFrame()->RecalcLayout(); ResizeParentToFit(FALSE); ResizeParentToFit(TRUE); The formview is still not sized properly. It looks like the problem is the toolbar on the top of the formview. It is not being taken into account in sizing the formview. The difference at the bottom of the form that is not displayed is the size of the toolbar. Any suggestions? Should work if your toolbar was created (and docked) back in your CMainFrame::OnCreate() method. ----- William Gower ...

Printing problem in booklet format
When I try to print my booklet document, on the screen it looks perfect, but when i go into print preview it only has half of each page on the paper. When i print, it comes out exactly like that. I have Publisher 2003 and run it on XP home. My printer is an Epson stylus Photo RX650. I contacted Epson and they say its a Publisher problem. Any suggestions. Driver? http://tech.epson.com.au/downloads/product.asp?sCategory=Multi_Functional&id=stylusphotorx650&FileType=1&EmailAdd=&MetricIDReturned=624915&platform=winxp Are you selecting booklet in page setup? Do you ...

problem opening up program/file
Hello, All. I am having some trouble opening up Word. It was working okay until I loaded some fonts to FontBook. Okay, now I removed all my fonts but I still get this error message about corrupt fonts I have on my computer. When I open Word, I see the blue starting-up window: Word:Mac 2004. Right underneath the product ID #, I see that it is initiating... when it gets to the point "Optimizing font menu performance" I start getting this error windows popping up one after another. (E.g. The font M TimesSmallText is corrupt and should be removed.) I keep on clicking okay for a whole lot...

Result in message box
HI, this is second time iam posting this ,,kindly help me a form contains button which runs a query like select count(field1) from table t1 ... then normally we will get a spread sheet window containing result in a single cell, let say answer is 85. now when command button is clicked then a message box should appear displaying the result 85.. please give coding also if required..... thanks naveen prasad wrote: > HI, > this is second time iam posting this ,,kindly help me > What was wrong with the reply you've already received? Please reply in your origina...

Money deluxe 2007 password problem
When I update my bank account transactions I get a message saying that my account was not updated because my password is incorrect. I then go into account info and have to update my password. I save the update, but then it happens again sporadically when I open Money at later times. Is there a way to fix this glitch? ...

Source data, in Chart Menu, is grey and not accessible.
I set up a pivot table and designed a chart, saved and closed out of the workbook. Upon returning to work on this project, when selecting the chart menu to work with my source data, the source data is grey and not accessible. What might be causing this and can I correct it? It's a pivot chart. As soon as it's created, it's linked permanently to the pivot table, and you cannot change the source data. you cannot add more data that's not in the pivot table to the chart, nor can you remove data that is in the pivot table from the chart. - Jon ------- Jon Peltier, Microsoft...

printing problems with memorized reports
We have recently been running into printing problems with our memorized reports. We will print preview a report and it will look fine on screen, then we will send to the printer, and the report print extremely small in the corner of the page. However if we go back in and re-print the report then it will print normal size on the page. We are not making any settings changes at all, and when it does this appears to just be at random. We are printing to an HP laserjet 4000 series printer that is on our network. We've used RMS with the same configuration for approx. 5 years now and ...

Reports and sub-reports problems
Dear Sirs,I have a report with 4 sub-reports.How can it be that 2 sub-reports are showing the data triple.Can someone help?ThanksKlaus I just realized. It's not due to being a subreport - it's already showing on the normal report triple data. It was not before and I did not change anything. I hope that someone can help me.Thanks Klaus"Amateur" wrote:> Dear Sirs,> I have a report with 4 sub-reports.> How can it be that 2 sub-reports are showing the data triple.> Can someone help?> Thanks> Klaus...

connection problems
a popup saying internet explorer cannot diaplay webpage and it is a connection problem -- eummer2010 how does your problem/question pertain to windows update? terri wrote: > a popup saying internet explorer cannot diaplay webpage and it is a > connection problem Hello Terry, Would be nice if you could tell us more information, like what OS you're using, Service Pack, what other security software are you running, if any? etc. IE6 ? IE7 ? IE8 ? Repoяt problems and check for solutions automatically <http://windowshelp.microsoft.com/Windows/en-US/Help/...

There is a problem with your printer settings.
There is a problem with your printer settings. Your printer has given Publisher an invalid value, and the printer could not be correctly initialized. Check your printer settings in the Windows control panel." 1. I only have one network printer 2. The network printer is not the default printer 3. I have deleted the printer, rebooted and reinstalled the latest printer drivers. 4. The printer name is less than 8 characters long. ... any idea what the problem is??? -- kirks What version Publisher? Do you have the service packs? http://www.microsoft.com/downloads/search.aspx?displaylan...