Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCDialog from a MFC dll... Pin
RobJones10-Mar-03 6:09
RobJones10-Mar-03 6:09 
GeneralRe: CDialog from a MFC dll... Pin
Bill Gates Antimatter Particle10-Mar-03 6:35
Bill Gates Antimatter Particle10-Mar-03 6:35 
GeneralRe: CDialog from a MFC dll... Pin
Alvaro Mendez10-Mar-03 7:36
Alvaro Mendez10-Mar-03 7:36 
GeneralChange menu name on run-time Pin
whofmans10-Mar-03 5:55
whofmans10-Mar-03 5:55 
GeneralRe: Change menu name on run-time Pin
RobJones10-Mar-03 6:16
RobJones10-Mar-03 6:16 
GeneralThanks! I have used it for language translation Pin
whofmans10-Mar-03 23:47
whofmans10-Mar-03 23:47 
GeneralThanks! I have used it for language translation Pin
whofmans10-Mar-03 23:51
whofmans10-Mar-03 23:51 
GeneralThanks! I have used it for language translation Pin
whofmans10-Mar-03 23:56
whofmans10-Mar-03 23:56 
Thanks!

Now automaticly all the menu-item texts goes through a translate function. So that my program works with different language's.
<br />
	// TRANSLATE THE MENUS!<br />
	CMenu *pMenu = GetMenu();<br />
	CMenu *pSubMenu;<br />
	CMenu *pSubSubMenu;<br />
<br />
	CString csMnuStr;<br />
	<br />
	for(int i=0; pMenu->GetMenuState(i, MF_BYPOSITION) != -1; i++) // MENU<br />
	{<br />
		if(pMenu->GetMenuString(i, csMnuStr, MF_BYPOSITION) < 1) // empty string<br />
			continue;<br />
<br />
		pMenu->ModifyMenu(i, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
		<br />
		pSubMenu = pMenu->GetSubMenu(i);	// Get menu items<br />
		<br />
		if(pSubMenu == NULL)	// Submenu does not exist<br />
			continue;<br />
		<br />
		for(int j=0; pSubMenu->GetMenuState(j, MF_BYPOSITION) != -1; j++) // SUBMENU<br />
		{<br />
			if(pSubMenu->GetMenuString(j, csMnuStr, MF_BYPOSITION) < 1)	// empty string<br />
				continue;<br />
<br />
			pSubMenu->ModifyMenu(j, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
<br />
			pSubSubMenu = pSubMenu->GetSubMenu(j);	// get sub menu items<br />
			<br />
			if(pSubSubMenu == NULL)	// SubSubMenu does not exist<br />
				continue;<br />
			<br />
			for(int k=0; pSubSubMenu->GetMenuState(k, MF_BYPOSITION) != -1; k++) // SUB-SUBMENU<br />
			{<br />
				if(pSubSubMenu->GetMenuString(k, csMnuStr, MF_BYPOSITION) < 1)	// empty string<br />
					continue;<br />
<br />
				pSubSubMenu->ModifyMenu(k, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
			}		<br />
		}<br />
	}<br />
	DrawMenuBar();<br />


Willem
GeneralRe: Change menu name on run-time Pin
Renjith Ramachandran10-Mar-03 7:49
Renjith Ramachandran10-Mar-03 7:49 
Generalnew comer Pin
Mr. Andrea10-Mar-03 5:16
Mr. Andrea10-Mar-03 5:16 
GeneralRe: new comer Pin
Maximilien10-Mar-03 5:29
Maximilien10-Mar-03 5:29 
GeneralRe: new comer Pin
Alvaro Mendez10-Mar-03 7:37
Alvaro Mendez10-Mar-03 7:37 
Generalsave increment filenames... Pin
macmac3810-Mar-03 5:10
macmac3810-Mar-03 5:10 
GeneralRe: save increment filenames... Pin
Maximilien10-Mar-03 5:24
Maximilien10-Mar-03 5:24 
GeneralRe: save increment filenames... Pin
Renjith Ramachandran10-Mar-03 7:54
Renjith Ramachandran10-Mar-03 7:54 
GeneralAdding icons to an imagelist that is used in a listctrl Pin
Jochem10-Mar-03 5:01
Jochem10-Mar-03 5:01 
GeneralRe: Adding icons to an imagelist that is used in a listctrl Pin
RobJones10-Mar-03 6:27
RobJones10-Mar-03 6:27 
GeneralRe: Adding icons to an imagelist that is used in a listctrl Pin
Jochem11-Mar-03 1:15
Jochem11-Mar-03 1:15 
QuestionHow to store a set of data while each data has several kinds of type ? Pin
adapterJohn10-Mar-03 4:56
adapterJohn10-Mar-03 4:56 
AnswerRe: How to store a set of data while each data has several kinds of type ? Pin
Tim Smith10-Mar-03 5:08
Tim Smith10-Mar-03 5:08 
AnswerRe: How to store a set of data while each data has several kinds of type ? Pin
valikac10-Mar-03 11:26
valikac10-Mar-03 11:26 
GeneralRe: How to store a set of data while each data has several kinds of type ? Pin
adapterJohn10-Mar-03 11:36
adapterJohn10-Mar-03 11:36 
GeneralRe: How to store a set of data while each data has several kinds of type ? Pin
valikac10-Mar-03 12:39
valikac10-Mar-03 12:39 
Generalclass template declaration in seperate files Pin
Julian Churchill10-Mar-03 4:51
Julian Churchill10-Mar-03 4:51 
GeneralRe: class template declaration in seperate files Pin
Tim Smith10-Mar-03 5:11
Tim Smith10-Mar-03 5:11 

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.