Context Menu w/Popup missing initial menu text

Hello. I've been trying to find the answer to this on my own, but it's
just not getting me anywhere.

I've put in a context menu with a popup. Problem is, I can't get the
first menu to display, but I can get the contents of the popup to show
up.

Here's the code I'm working with.

BOOL CGUISnoopView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
pResult)
{
CGUISnoopDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);


   if((((NMHDR*)lParam)->code
==NM_RCLICK)&&m_pGrid->GetFocusCell().row>0)
	{
	CMenu menu;
	VERIFY(menu.LoadMenu(IDR_POP_MENU));
	CPoint pt;
	GetCursorPos(&pt);
	CMenu* pPopup = menu.GetSubMenu(0);
	ASSERT(pPopup !=NULL);
	menu.TrackPopupMenu(TPM_RIGHTBUTTON,pt.x,pt.y,this);
        //pPopup->TrackPopupMenu(TPM_RIGHTBUTTON,pt.x,pt.y,this);
        menu.DestroyMenu();
	}
  	return CView::OnNotify(wParam, lParam, pResult);
}

Using the code above, I get a thin bar with no text in it, but I do get
access to the popup menu commands, which also operate.
I've used the GetMenuString function to verify that the text should be
displayed, but it's not. I can use the function that's set to a
non-popup section of the menu as well, but I can't see the text.

When I was using .CreatePopup, I was able to get the context menu
(without a popup)to work by doing this:

	CMenu menu;
	menu.CreatePopupMenu();
	menu.AppendMenu(0,ID_FINDNEXT,"Find Next");
	menu.AppendMenu(MF_SEPARATOR,0,"");
 	menu.AppendMenu(0,ID_FILTERSTRING, "Filter String");
        menu.Destroy();

But it's easier to change the menu in the resource editor, and ease of
modification is a very important part of this program.

It looks like there have been a good number of these questions already,
but none of the answets seem to work.

Oh: GetFocusCell is part of a modified grid control that returns the
cell coordinates of the current selection.

Can anyone tell me how to get the text to appear on the first level of
the menus?

Thanks in advance.

0
birdinhand (24)
9/19/2005 10:20:33 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
748 Views

Similar Articles

[PageSpeed] 48

Reply:

Similar Artilces:

Where is the data menu for sorting lists?
Am trying to sort an address list into alphabetical order. Help says click on list and and select from data menu. When i click no data menu appears. can anyone help please? Thank you. Do you want to tell us what Office program you're referring to, and what version of that program? Daddy "Shakoh" <Shakoh@discussions.microsoft.com> wrote in message news:7E04A2BD-DA32-462B-A912-5469035351C9@microsoft.com... > Am trying to sort an address list into alphabetical order. Help says click > on > list and > and select from data menu. When i click no...

Publisher
I have prepare a publisher flyer which I will be sending out in a group e-mail. The view of the flyer shows the text boxes as well as the text. How can I delete the text boxes only and not the text. This is the first time I am using publisher. The text box boundary will not print unless you have put a border around it. Have you looked at print preview? Go to view, clear boundaries and guides, you will see how the flyer will look when printed. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Ladybug" <Ladybug@disc...

Text to speech particular cell
hi ive been trying for a while now to get the text to speech function to work for a particular cell. For example, i have a set of numbers and a total in D15, what i would like is that if i change the numbers that contribute to that total, and the total in D15 changes then excel will alert me saying "Change in Total". ive tried and failed to get it notice the changed total and would really appreciate some help Thank You for any contributions Let's put the message in a cell, say D16. In a standard module insert the follow line: Public OldVar As Variant Insert the following...

Numbers V Text
I want to print out a document but I don't want it all printed out in numbers I want the text printed out. Here is what I don't want it say 223, I want to say =SUM(C7:C11)/15 I am sure it can be done via "Options" but I can't work out how. Jim Ducat Toggle the view to Formula View - Ctrl + ` (that's the same key as the tilde ~) MRO "James Ducat" <jd007f1618@blueyonder.co.uk> wrote in message news:x627b.16604$qK6.394@news-binary.blueyonder.co.uk... > I want to print out a document but I don't want it all printed out in > numbers I wan...

Outlook Message Inline Text
I have Outlook 2002 and need to know if I can change my received message format to inline text. Right now I have e-mails that have been forwarded multiple times as attachments instead of inline text but I can't synchronize it with my Pocket PC because of this. Any Suggestions? Thanks, Benny ...

Selecting text for Emailing
Hello, I have question that maybe someone could help me with. I have a database where on the form I placed a command button to send emails. Works great and in fact, I even got it to pull the information from selceted fields on the current record. What I would like to know is: Is there a way to pick up the name of the field and have the information that was inputted in that field appear next to the name in the email? For Example: Currently my email body picks up only the information so the loan number field only shows the loan number and the Date In field only show a date. 123456789 1...

Changing menu bar height
Hello, is there a way to change the menu bar height of an application? Regards, Nicola I dont see how that can be done without replacing the whole menu mechanism. You can do that if you want by putting in a toolbar/rebar which acts as a menu. Example MFCIE shows how to make a toolbar as a menu. YOu can change the height of the toolbar/rebar to what you want. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Nicolas Bonamy" <mynab@hotmail.com> wrote in message news:OUgmBPOjDHA.2644@TK2MSFTNGP10.phx.gbl... | Hello, | | is there a way to change the menu bar height of an appl...

Menu od child windows
Hi! Is it possible to put menu od child window when using MDI? "Jolpez" <jolpez@no.com> wrote in message news:hq2qcn$7ld$1@gregory.bnet.hr... > Is it possible to put menu od child window when using MDI? Yes, you can use the MdiWindowListItem property of the MenuStrip to set the ToolStripMenuItem that should display the list of child forms. "Jolpez" <jolpez@no.com> wrote in message news:hq2qcn$7ld$1@gregory.bnet.hr... > Is it possible to put menu od child window when using MDI? Please tell us which word you meant to type inste...

Separate data string into numeric and text
Hi Can anyone help me with a script, to read in a string of mixed numerical and text data, and separate them to a specific format of spacing. This is the raw data: 11-11-11,44444444,JOE R BLOGGS,2757.42, I need to convert the data into 11111144444444JOE R BLOGGS 2757.42 Firstly i need to remove the "-" and ",", so that it all joins up. There needs to be 6 chars at the start for 111111. At the 7th char i need to leave space for 8 digits (44444444 - although sometimes the no. being read in will be less than this). Then 15 chars must be left for name, and the amount will...

Outlook Plain Text Setting
I am starting to move my users over to Outlook and Exchange 2003. I noticed that by default Outlook is setting the users up as HTML e-mail. Is there a way that I can set all of my users up with Plain Text for e-mail? Thanks, Jeff That is a user setting, of course, under Tools-->Options-->Mail Format You can use the following to ensure inbound email is read as plain text, and therefor replies will be plain text: http://www.outlook-tips.net/howto/plain_text.htm "Jeff Grossman" <jeff.nospam@stikman.com> wrote in message news:lcr542hthnrf6qfqikqrm4cdebs11ikuaa@4ax.co...

Help Text for Radio Buttons
I am trying to create a survey form with multiple choice radio buttons. I want to add descriptive text that appears when you float your cursor over the button (like that for a toolbar icon). I've scoured Excel help and couldn't find anything. I don't have experience with macros or Visual Basic but am willing to try if someone can hold my hand through it. If the radio button is in a cell, add a comment to the cell. Then the instructions will appear when the mouse hovers over the cell. -- Damon Longworth Don't miss out on the 2005 Excel User Conference Sept 16th and 17th...

CSV formatted text file to Excel
Hi all, I am writing a small VC++ application of how to import the CSV formatted ..txt file to excel. I am facing problem while parsing the text file. "TicketNo","CarNo","PersonAge" 12534 , 763534 , 23 12345 , 624333, 24 The problem is in MFC there is a SetValue2(CoeVariant:column data) method in which if i will pass an array(12534) then it will be imported to excel.For example IfI will search for the "employee number" field in text file then the values passed to SetValue2()should be 12543 and 12345.But Using C++ I cannot do so as I...

Mouse Menu
Can I add specific commands to the "right-click" mouse menu? Can I add macros? Hi as starting point some code: Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "Now you code yould start" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In Co...

inserting texts in cell based on conditions
Hi, I would very much appreciate if someone could help me solving a problem, illustrated by the following example: Column A B C 1 1 "LB" 2 1 "DK" 3 4 1 1 "LB/DK" If there's a 1 in column A, the corresponding cell in column C should get the text "LB" inserted into it. If there's a 1 in column C, the corresponding cell in column C should get the text "DK" inserted into it. If both column A and B have ones in them, the corresponding cell should get the...

Outlook formatting of columns to wrap text in Task view
I have used multi-line layout to view tasks but it does not show in print preview. Is it possible to wrap text if the number of characters exceed the column width? If so, can we print it in the same format? Would appreciate your reply. Thanks. Jay ...

Outlook Client error w/MSDE SP4
When I try to install the Outlook Laptop client, it passes through everything but the MSDE Service Pack 4. It gets about halfway through the install and fails saying "User cancelled installation". I didn't do anything to cancel the installation. This happens on two laptops. The laptops are also running SBA, not sure if that's a factor or not. Either of 2 things are happening: you already have a default instance of MSDE installed on the laptops and you need to define an instancename (generally you will want to use the instancename: crm) or your MSDE install has a d...

Can Access 2007 analyze w/Excel?
I have installed Office 2007 and I am not able to locate the option to Analyze a report with Excel. I was able to do this with Access 2003 and it would put all the data from a report into an Excel file. How do I do this in Access 2007? I do not see the option anywhere after opening the report. Thanks, CEV I forgot to mention that when I have the report open, The export to Excel option is greyed out as is the sharepoint list option right next to it. Thanks, CEV "CEV" <chadv@advancebkg.com> wrote in message news:fg52n601iel@enews5.newsguy.com... >I have installed...

Palm V Sync w/ Business Contact Manager
Has anyone been able to get their Palm device to sync with Outlook 2003 with Business Contact Manager. Intellisync does not support this yet. You answered your own question. Once intellisync supports this, then = you should be able to set your preferred .pst file. --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After searching google.groups.com and finding no answer: Jim <jfjordan@prodigy.net> asked: | Has anyone been able to get their Palm device to sync | with Outlook 2003 with Business Contact Manager. |=20 | Intellisync does...

Problem Sending Mail w/Outlook 2002
I receive and send a lot of email using Outlook 2002 and my Gmail account with no problem. However, I have two friends to whom I send emails that are always returned. I get an error message like this: Technical details of permanent failure: PERM_FAILURE: SMTP Error (state 9): 550 Invalid recipient: However, if I send the emails to them directly from Gmail, they go through just fine. Can anyone explain why they fail with Outlook? Pat This sounds like an issue with the SMTP server you have setup in outlook - not outlook itself. "patetc" <PatETC@gmail.com> wrote in messag...

Remove menu from MDI control
I'm using VC++ 6.0 on WinXP. With an MDI control, how do I remove the menu (file, print, help, etc)? I don't want it to show in the application at all. -karen In resource editor, you can remove it from all the menus that have it. For MDI, it will appear in more than one menu. The number depends upon the number of doctemplates in your application. If you want to remove the entire menubar, see the following article in MSDN: http://support.microsoft.com/default.aspx?scid=kb;en-us;131368 -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "karen" <nothing@nospam.com>...

Parse multiple text lines into 1 line in excel
help. I am an excel beginner and can't find out how to turn multipl lines of text into 1 row in excel. It's probably really easy but m manual is USELESS. Can anyone help ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com debbie You're a little short on details. If nothing below fits the bill post back. "Multiple lines" is how many and is each line in a separate cell down one column? Do you want all lines to go into one cell? You can use this form...

allowing a text box to grow
Is it difficult to have a CEdit control and its dialog grow according to the length of the string in the control? I'm interested in using such an arrangement for my error messages and would like it to fit my messages. Use DrawText to compute the rectangle required and resize your control to accomodate it. joe On Tue, 27 Mar 2007 18:31:07 -0400, "SteveR" <srussell@removethisinnernet.net> wrote: >Is it difficult to have a CEdit control and its dialog grow according to the >length of the string in the control? I'm interested in using such an >arra...

Copy and Paste text to Word
I have a large spreadsheet of data. There are no values or formulas. I need to cut and past this into word in a way that shows the paste only as text - normally it has an outline of the cells. Reason is that I need to save this as a .txt file for an upload to another system. Thanks in advance (again) > way that shows the paste only as text In Word, try: Edit > Paste special > Unformatted Text -- Rgds Max xl 97 --- Please respond, in newsgroup xdemechanik <at>yahoo<dot>com ---- "AndrewS" <anonymous@discussions.microsoft.com> >I have a large spr...

privilege missing for opportunityproduct
Hi All, Does anyone know about prvCreateOpportunityProduct privilege. This privilege is mentioned into the SDK help for CRM 3 but I cannot find it from the database. Is it a way to add it back so the user can add or update an opportunity product without the write access on opportunity and product. thanks. ...

Error? Missing banks in Money 2005...
I am missing my bank for downloading in Money 2005 even though it is listed as supported on the Money website. In fact it appears that the list in Money 2005 is about 25% that of what appears on the website. Am I doing something wrong or is Microsoft false advertising their product? Thanks There appear to be a number of missing banks now, but our understanding is that the list will be updated soon. -- "Brad" <anonymous@discussions.microsoft.com> wrote in message news:414501c49f60$13cb3da0$a401280a@phx.gbl... >I am missing my bank for downloading in Money 2005 even &g...