Wednesday, February 3, 2016

Under Mobile5.0 simulator, Error creating menu




            


When performing the following procedures: SHMENUBARINFO mbi;
ZeroMemory (& amp; mbi, sizeof (SHMENUBARINFO));
mbi.cbSize = sizeof (SHMENUBARINFO);
mbi.hwndParent = m_hWnd;
mbi.nToolBarId = IDR_MENU1;
mbi.hInstRes = _Module.m_hInst;
if (SHCreateMenuBar (& amp;! mbi)); here SHCreateMenuBar (& amp; mbi) = 0, the direct return -1 !!
{
return -1;
}
All lead to the following to create a window of the program is skipped, how it happened?

Reply:
Your smartphone or PPC is ah?


If the smartphone this function is not supported.
Reply:
SHMENUBARINFO mbi;
memset (& amp; mbi, 0, sizeof (SHMENUBARINFO));
mbi.cbSize = sizeof (SHMENUBARINFO);
mbi.hwndParent = m_hWnd;
mbi.dwFlags | = SHCMBF_HMENU;
mbi.nToolBarId = IDR_MENU1;
mbi.hInstRes = :: AfxGetInstanceHandle ();
mbi.nBmpId = 0;
mbi.cBmpImages = 0;

if (SHCreateMenuBar (& amp;! mbi))
{
return -1;
}

Reply:
This sentence is the key
mbi.dwFlags | = SHCMBF_HMENU

No comments:

Post a Comment