Hi, I've searched pocketpcdn and found the article. But following method
doesn't work. It returns false. Can you give me any idea why? IDR_MENU_MAP is
a menu I created with the resource editor. This code is inside
OnInitDialog().

SHMENUBARINFO info;
info.cbSize = sizeof(info);
info.hwndParent = m_hWnd;
info.dwFlags = 0;
info.nToolBarId = IDR_MENU_MAP;
info.hInstRes = ::AfxGetInstanceHandle();
info.nBmpId = 0;
info.cBmpImages = 0;

if(SHCreateMenuBar(&info))
AfxMessageBox(_T("true"));
else
AfxMessageBox(_T("false"));

Re: VS2005 PocketPC2003 Second Edition Menubar on Dialog by r_z_aret

r_z_aret
Fri Feb 03 15:08:15 CST 2006

On Thu, 2 Feb 2006 13:41:29 -0800, "zikje"
<zikje@discussions.microsoft.com> wrote:

>Hi, I've searched pocketpcdn and found the article. But following method
>doesn't work. It returns false. Can you give me any idea why? IDR_MENU_MAP is
>a menu I created with the resource editor. This code is inside
>OnInitDialog().

I can't see anything wrong. I suggest calling GetLastError to get a
bit more info when SHCreateMenuBar fails. My best bet is a problem in
the menu resource.


>
>SHMENUBARINFO info;
>info.cbSize = sizeof(info);
>info.hwndParent = m_hWnd;
>info.dwFlags = 0;
>info.nToolBarId = IDR_MENU_MAP;
>info.hInstRes = ::AfxGetInstanceHandle();
>info.nBmpId = 0;
>info.cBmpImages = 0;
>
>if(SHCreateMenuBar(&info))
> AfxMessageBox(_T("true"));
>else
> AfxMessageBox(_T("false"));

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com