Click here to Skip to main content
15,905,148 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionmsscript.ocx probelm? Pin
falsevapor22-Mar-07 11:31
falsevapor22-Mar-07 11:31 
QuestionDigitizing w/ DirectShow in Visual C++ Pin
BlackWilson22-Mar-07 10:50
BlackWilson22-Mar-07 10:50 
AnswerRe: Digitizing w/ DirectShow in Visual C++ Pin
Mark Salsbery22-Mar-07 11:23
Mark Salsbery22-Mar-07 11:23 
AnswerRe: font problem with CreateWindow Pin
Michael Dunn22-Mar-07 10:33
sitebuilderMichael Dunn22-Mar-07 10:33 
GeneralRe: font problem with CreateWindow [modified] Pin
shaderx22-Mar-07 10:41
shaderx22-Mar-07 10:41 
GeneralRe: font problem with CreateWindow Pin
John R. Shaw22-Mar-07 21:53
John R. Shaw22-Mar-07 21:53 
GeneralRe: font problem with CreateWindow Pin
Michael Dunn27-Mar-07 20:49
sitebuilderMichael Dunn27-Mar-07 20:49 
QuestionMenus overlapping each other Pin
Alex Cutovoi22-Mar-07 10:09
Alex Cutovoi22-Mar-07 10:09 
Hi folks

I've created a class that create dynamic menus this is the code of the method that creates hte menus:
<br />
void Menu::InsertNewMenuItem(HMENU hParentMenu, HWND hwWindowOwner, unsigned int uiMenuID, unsigned int uiMenuBehavior, char * cMenuText)<br />
{<br />
   int iSize = m_uiMenuID.size();<br />
   m_uiMenuID.push_back(uiMenuID);<br />
   m_uiBehavior.push_back(uiMenuBehavior);<br />
   m_cMenuName.push_back(cMenuText);<br />
   if(iSize <= 0)<br />
   {<br />
	  AppendMenu(hParentMenu, m_uiBehavior[0], m_uiMenuID[0], m_cMenuName[0]);<br />
	  m_hSubMenu = CreateMenu();<br />
   }<br />
   else<br />
   {<br />
      AppendMenu(m_hSubMenu, m_uiBehavior[iSize], m_uiMenuID[iSize], m_cMenuName[iSize]);<br />
	  AppendMenu(hParentMenu, m_uiBehavior[0], (unsigned int)m_hSubMenu, m_cMenuName[0]);<br />
   }<br />
   SetMenu(hwWindowOwner, hParentMenu);<br />
}<br />

This code is in my callback
<br />
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)<br />
{<br />
   HMENU hMainMenu = CreateMenu();<br />
   char * cMainName = "Principal1";<br />
   char * cName1    = "Menu 1";<br />
   char * cName2    = "Menu 2";<br />
   char * cName3    = "Menu 3";<br />
   char * cName4    = "Menu 4";<br />
   char * cName5    = "Menu 5";<br />
   char * cName6    = "Principal2";<br />
   char * cName7    = "Menu 7";<br />
   char * cName8    = "Menu 8";<br />
   char * cName9    = "Menu 9";<br />
   char * cName10   = "Menu 10";<br />
   int iIDS[] = {6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010};<br />
   switch(uiMessage)<br />
   {<br />
	  case WM_CREATE:<br />
	  {<br />
		 theMenu  = new Menu();<br />
		 theMenu2 = new Menu();<br />
		 break;<br />
	  }<br />
          case WM_CHAR:<br />
	  {<br />
		 switch(wParam)<br />
		 {<br />
		    case 'a':<br />
			{<br />
			   theMenu->InsertNewMenuItem(hMainMenu, hwnd, iIDS[0], MF_STRING|MF_POPUP, cMainName);<br />
			   DrawMenuBar(hwnd);<br />
			   break;<br />
			}<br />
			case 's':<br />
			{<br />
			   theMenu2->InsertNewMenuItem(hMainMenu, hwnd, iIDS[1], MF_STRING, cName1);<br />
			   DrawMenuBar(hwnd);<br />
			   break;<br />
			}<br />
.....<br />

The problem that I have is: I have 2 menus. When I call the method pressing "a", a submenu is inserted in the first menu. When I call the method pressing "s" to insert a new submenu in the OTHER menu, the first one is overlapped with the first. The same is valid when I insert a submenu in the second menu and insert a valid a submenu in the first menu.
What going on? It's very strange. Am I clear enough for you?
AnswerRe: Menus overlapping each other Pin
Michael Dunn22-Mar-07 10:27
sitebuilderMichael Dunn22-Mar-07 10:27 
Questiondynamic linking with DirectX Pin
shaderx22-Mar-07 8:43
shaderx22-Mar-07 8:43 
AnswerRe: dynamic linking with DirectX Pin
Cedric Moonen22-Mar-07 9:25
Cedric Moonen22-Mar-07 9:25 
AnswerRe: dynamic linking with DirectX Pin
led mike22-Mar-07 9:31
led mike22-Mar-07 9:31 
AnswerRe: dynamic linking with DirectX Pin
Michael Dunn22-Mar-07 10:31
sitebuilderMichael Dunn22-Mar-07 10:31 
AnswerRe: dynamic linking with DirectX Pin
shaderx22-Mar-07 10:39
shaderx22-Mar-07 10:39 
GeneralRe: dynamic linking with DirectX Pin
Mark Salsbery22-Mar-07 11:25
Mark Salsbery22-Mar-07 11:25 
QuestionPassing Variables to Thread Process [modified] Pin
darkcloud.42o22-Mar-07 8:28
darkcloud.42o22-Mar-07 8:28 
AnswerRe: Passing Variables to Thread Process Pin
Mark Salsbery22-Mar-07 9:15
Mark Salsbery22-Mar-07 9:15 
GeneralRe: Passing Variables to Thread Process Pin
darkcloud.42o22-Mar-07 10:05
darkcloud.42o22-Mar-07 10:05 
GeneralRe: Passing Variables to Thread Process Pin
Mark Salsbery22-Mar-07 10:11
Mark Salsbery22-Mar-07 10:11 
AnswerRe: Passing Variables to Thread Process Pin
led mike22-Mar-07 9:16
led mike22-Mar-07 9:16 
AnswerRe: Passing Variables to Thread Process Pin
David Crow22-Mar-07 9:34
David Crow22-Mar-07 9:34 
GeneralRe: Passing Variables to Thread Process Pin
led mike22-Mar-07 9:40
led mike22-Mar-07 9:40 
GeneralRe: Passing Variables to Thread Process Pin
darkcloud.42o22-Mar-07 10:25
darkcloud.42o22-Mar-07 10:25 
QuestionRe: Passing Variables to Thread Process Pin
David Crow22-Mar-07 10:33
David Crow22-Mar-07 10:33 
AnswerRe: Passing Variables to Thread Process [modified] Pin
darkcloud.42o22-Mar-07 10:39
darkcloud.42o22-Mar-07 10:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.