Hello All,
I'm creating an application under PPC2003.
Concerning the architecture, I have a principal application doing the
treatments I want, and 2 "language-dlls" (one in english, one in french)
which only contain the resources that I will use in the main application. So,
according to the users language choice in the main programm, I load one or
the other dll.
For dynamically getting the Strings in the main prog, I use :
int LoadString(
HINSTANCE hInstance,
UINT uID,
LPTSTR lpBuffer,
int cchBufferMax
);
and it works well.
But now I want to load dynamically the menubar. 2 different things :
1]
m_hLanguageDLL = LoadLibrary(...);
(->it is well loaded)
SHMENUBARINFO info;
info.cbSize = sizeof(info);
info.hwndParent = m_hWnd;
info.dwFlags = 0;
info.nToolBarId = IDR_MENUBAR;
info.hInstRes = m_hLanguageDLL;<----- not working
//info.hInstRes = AfxGetInstanceHandle();<----- working
info.nBmpId = 0;
info.cBmpImages = 0;
SHCreateMenuBar(&info);
From here, Dialog opens, but no menubar...
(SHCreateMenuBar returns false)
So, What is the problem?
2]
HMENU loadedMenu = ::LoadMenu(m_hLanguageDLL,MAKEINTRESOURCE(IDR_MENUBAR));
if(loadedMenu == NULL){
AfxMessageBox(_T("LoadMenu failed"));
}
else{
CMenu men;
men.Attach(loadedMenu);
//WORKING
//men.GetSubMenu(0)->TrackPopupMenu( TPM_LEFTALIGN, 0, 0, this);
//NOT WORKING
SetMenu(&men);
}
Here I can get the Menu but I don't know how to display it. I tried many
things but without success.
Please help me!
Fab W