Click here to Skip to main content
15,919,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDebug VS Release Pin
FarPointer1-Nov-05 16:24
FarPointer1-Nov-05 16:24 
AnswerRe: Debug VS Release Pin
Prakash Nadar1-Nov-05 16:45
Prakash Nadar1-Nov-05 16:45 
AnswerRe: Debug VS Release Pin
Prakash Nadar1-Nov-05 17:37
Prakash Nadar1-Nov-05 17:37 
GeneralRe: Debug VS Release Pin
FarPointer1-Nov-05 17:55
FarPointer1-Nov-05 17:55 
Questionhow to get print message if you click print a document by Microsoft word? Pin
szcococut1-Nov-05 15:37
szcococut1-Nov-05 15:37 
QuestionDisabled Menu after Modification Pin
romuzu1-Nov-05 15:36
romuzu1-Nov-05 15:36 
QuestionRe: Disabled Menu after Modification Pin
Prakash Nadar1-Nov-05 16:14
Prakash Nadar1-Nov-05 16:14 
AnswerRe: Disabled Menu after Modification Pin
romuzu1-Nov-05 16:51
romuzu1-Nov-05 16:51 
Thanks for the reply.

Here's what I did.

I don't have any idea why its getting disabled. It got disabled after translating the text from english to japanese.

First I open a text file which contains the original text and its translation.
The contents were read and was stored to a map(STL). I've also created a recursive function to traverse the menu and translate the text.
From that recursive function I get the submenus and the number of items under that submenus.

Here's the code:

void CTranslator::TranslateMenu(CMenu* pMenu, int MenuCount)
{
CMenu* SubMenu;
CString String;
char MenuString[50];
int SubMenuCount = 0;
int Index = 0;

do // while (MenuCount != Index)
{
ZeroMemory(MenuString, 50);
pMenu->GetMenuString( Index, MenuString, 50, MF_BYPOSITION);

String.Format ("%s", MenuString);

if(! String.IsEmpty())
{
pMenu->ModifyMenu(Index, MF_BYPOSITION, MF_POPUP, GetTranslation( String ) );
}

SubMenu = pMenu->GetSubMenu(Index);

if(NULL != SubMenu)
{
SubMenuCount = SubMenu->GetMenuItemCount ();
TranslateMenu(SubMenu, SubMenuCount);
}// if(NULL != SubMenu)

pMenu->EnableMenuItem (Index, MF_ENABLED);
Index++;
}while (MenuCount != Index);
}// CTranslator::TranslateMenu(CMenu *pMenu)


GeneralRe: Disabled Menu after Modification Pin
Prakash Nadar1-Nov-05 17:17
Prakash Nadar1-Nov-05 17:17 
GeneralRe: Disabled Menu after Modification Pin
romuzu1-Nov-05 18:46
romuzu1-Nov-05 18:46 
GeneralRe: Disabled Menu after Modification Pin
Prakash Nadar1-Nov-05 20:06
Prakash Nadar1-Nov-05 20:06 
Questionhow to use UML in my VC++ project? Pin
ewighell1-Nov-05 15:33
ewighell1-Nov-05 15:33 
AnswerRe: how to use UML in my VC++ project? Pin
Prakash Nadar1-Nov-05 15:41
Prakash Nadar1-Nov-05 15:41 
GeneralRe: how to use UML in my VC++ project? Pin
ewighell1-Nov-05 15:51
ewighell1-Nov-05 15:51 
GeneralRe: how to use UML in my VC++ project? Pin
Prakash Nadar1-Nov-05 16:11
Prakash Nadar1-Nov-05 16:11 
GeneralRe: how to use UML in my VC++ project? Pin
ewighell1-Nov-05 17:11
ewighell1-Nov-05 17:11 
QuestionLocalAlloc and LocalFree Pin
plowstar1-Nov-05 15:02
plowstar1-Nov-05 15:02 
AnswerRe: LocalAlloc and LocalFree Pin
Prakash Nadar1-Nov-05 15:44
Prakash Nadar1-Nov-05 15:44 
AnswerRe: LocalAlloc and LocalFree Pin
S. Senthil Kumar1-Nov-05 19:23
S. Senthil Kumar1-Nov-05 19:23 
QuestionC++ based system service Pin
c++code1011-Nov-05 14:50
c++code1011-Nov-05 14:50 
AnswerRe: C++ based system service Pin
__yb1-Nov-05 21:08
__yb1-Nov-05 21:08 
QuestionHow to use ExtractIcon or ExtractIconEx to get a handle for the small Icon? Pin
Tcpip20051-Nov-05 14:37
Tcpip20051-Nov-05 14:37 
AnswerRe: How to use ExtractIcon or ExtractIconEx to get a handle for the small Icon? Pin
Prakash Nadar1-Nov-05 15:49
Prakash Nadar1-Nov-05 15:49 
GeneralRe: How to use ExtractIcon or ExtractIconEx to get a handle for the small Icon? Pin
Tcpip20051-Nov-05 16:19
Tcpip20051-Nov-05 16:19 
GeneralRe: How to use ExtractIcon or ExtractIconEx to get a handle for the small Icon? Pin
Prakash Nadar1-Nov-05 16:37
Prakash Nadar1-Nov-05 16:37 

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.