Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to convert a BSTR into a character array Pin
pandit8423-Aug-09 22:36
pandit8423-Aug-09 22:36 
AnswerRe: How to convert a BSTR into a character array Pin
«_Superman_»23-Aug-09 22:44
professional«_Superman_»23-Aug-09 22:44 
AnswerRe: How to convert a BSTR into a character array Pin
Rajesh R Subramanian23-Aug-09 22:49
professionalRajesh R Subramanian23-Aug-09 22:49 
AnswerRe: How to convert a BSTR into a character array Pin
Stuart Dootson23-Aug-09 23:23
professionalStuart Dootson23-Aug-09 23:23 
GeneralRe: How to convert a BSTR into a character array Pin
pandit8424-Aug-09 0:04
pandit8424-Aug-09 0:04 
QuestionSimple Menus That Display Icons in Win32 API (No MFC) Pin
Aabid23-Aug-09 21:22
Aabid23-Aug-09 21:22 
AnswerRe: Simple Menus That Display Icons in Win32 API (No MFC) Pin
David Crow24-Aug-09 3:19
David Crow24-Aug-09 3:19 
GeneralRe: Simple Menus That Display Icons in Win32 API (No MFC) Pin
Aabid25-Aug-09 0:36
Aabid25-Aug-09 0:36 
Hi david can u guide me how to convert this function to Win32 API,
ie how can i handle this function as message

void CMainFrame::OnInitMenu(CMenu* pMenu)
{
#if _MFC_VER < 0x0800
#undef __FUNCTION__
#define __FUNCTION__ "OnInitMenu()"
#endif // _MFC_VER < 0x0800
AfxTrace(_T(__FUNCTION__) _T(": %#0x\n"), pMenu->GetSafeHmenu());

MENUITEMINFO minfo;
minfo.cbSize = sizeof(minfo);

for (UINT pos=0; pos<pMenu->GetMenuItemCount(); pos++)
{
minfo.fMask = MIIM_FTYPE | MIIM_ID;
pMenu->GetMenuItemInfo(pos, &minfo, TRUE);

HICON hIcon = GetIconForItem(minfo.wID);

if (hIcon && !(minfo.fType & MFT_OWNERDRAW))
{
AfxTrace(_T("replace for id=%#0x\n"), minfo.wID);

minfo.fMask = MIIM_FTYPE | MIIM_BITMAP;
minfo.hbmpItem = HBMMENU_CALLBACK;
minfo.fType = MFT_STRING;

::SetMenuItemInfo(pMenu->GetSafeHmenu(), pos, TRUE, &minfo);
}
else
AfxTrace(_T("keep for id=%#0x\n"), minfo.wID);
// ::DestroyIcon(hIcon); // we use LR_SHARED instead
}
}

We Have To Conert it into case WM_INITMENU:
AnswerRe: Simple Menus That Display Icons in Win32 API (No MFC) Pin
David Crow25-Aug-09 2:33
David Crow25-Aug-09 2:33 
QuestionKeeping a thread idle for a while Pin
sunny_vc23-Aug-09 20:15
sunny_vc23-Aug-09 20:15 
AnswerRe: Keeping a thread idle for a while Pin
Adam Roderick J23-Aug-09 20:22
Adam Roderick J23-Aug-09 20:22 
AnswerRe: Keeping a thread idle for a while Pin
Cedric Moonen23-Aug-09 20:25
Cedric Moonen23-Aug-09 20:25 
AnswerRe: Keeping a thread idle for a while Pin
Rajesh R Subramanian23-Aug-09 20:46
professionalRajesh R Subramanian23-Aug-09 20:46 
QuestionDll Pin
rdop23-Aug-09 20:14
rdop23-Aug-09 20:14 
AnswerRe: Dll Pin
rdop23-Aug-09 20:51
rdop23-Aug-09 20:51 
QuestionGetting process ID Pin
Le@rner23-Aug-09 19:31
Le@rner23-Aug-09 19:31 
AnswerRe: Getting process ID Pin
«_Superman_»23-Aug-09 19:44
professional«_Superman_»23-Aug-09 19:44 
QuestionTree Control without check box in the root Pin
Ranojay23-Aug-09 19:24
Ranojay23-Aug-09 19:24 
AnswerRe: Tree Control without check box in the root Pin
zhu_lin23-Aug-09 20:49
zhu_lin23-Aug-09 20:49 
GeneralRe: Tree Control without check box in the root Pin
Ranojay23-Aug-09 20:54
Ranojay23-Aug-09 20:54 
GeneralRe: Tree Control without check box in the root Pin
zhu_lin23-Aug-09 21:12
zhu_lin23-Aug-09 21:12 
QuestionRe : Displaying the icons only for subitems in the CListCtrl. Pin
Gokul_md23-Aug-09 19:08
Gokul_md23-Aug-09 19:08 
AnswerRe: Re : Displaying the icons only for subitems in the CListCtrl. Pin
«_Superman_»23-Aug-09 19:50
professional«_Superman_»23-Aug-09 19:50 
QuestionPosting messages while using multiple threads Pin
PaulowniaK23-Aug-09 16:10
PaulowniaK23-Aug-09 16:10 
AnswerRe: Posting messages while using multiple threads Pin
«_Superman_»23-Aug-09 18:34
professional«_Superman_»23-Aug-09 18:34 

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.