Click here to Skip to main content
15,921,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Creating a setup wizard Pin
Nish Nishant17-Mar-02 22:12
sitebuilderNish Nishant17-Mar-02 22:12 
QuestionHow I can add handler for Toolbar button in VS.NET (VC/MFC) Pin
17-Mar-02 16:36
suss17-Mar-02 16:36 
AnswerRe: How I can add handler for Toolbar button in VS.NET (VC/MFC) Pin
Nish Nishant17-Mar-02 16:59
sitebuilderNish Nishant17-Mar-02 16:59 
GeneralRe: How I can add handler for Toolbar button in VS.NET (VC/MFC) Pin
17-Mar-02 19:03
suss17-Mar-02 19:03 
Generalwhere to get the windows xp icon (the icon for App ,Toolbar...) Pin
benben17-Mar-02 16:08
benben17-Mar-02 16:08 
GeneralRe: where to get the windows xp icon (the icon for App ,Toolbar...) Pin
Nish Nishant17-Mar-02 16:30
sitebuilderNish Nishant17-Mar-02 16:30 
GeneralRe: where to get the windows xp icon (the icon for App ,Toolbar...) Pin
lszyn27-Mar-02 23:52
lszyn27-Mar-02 23:52 
GeneralWTL menu driving me nuts... Pin
AlphaDog17-Mar-02 14:57
AlphaDog17-Mar-02 14:57 
This is driving me crazy Mad | :mad: , wonder if anyone can help.

I'm am having some serious problems with GetMenuItemInfo and
SetItemInfo using WTL, but only with the dwItemData memeber, everything else seems to work
fine...

Let's say in OnCreate I try to add some data to the ID_FILE_NEW Menu
Item like so: lets make it a simple DWORD instead of a pointer just to keep things
clear...

CMenuItemInfo mii;

CMenuHandle menu = m_CmdBar.GetMenu();
CMenuHandle submenu = menu.GetSubMenu(0);

mii.fMask = MIIM_DATA | MIIM_ID;
mii.dwItemData = 1001;
mii.wID = ID_FILE_NEW;

if( submenu.SetMenuItemInfo(ID_FILE_NEW,FALSE,&mii) == 0 )
{
// Little helper function
ShowLastError();
}

Then when I the user selects the menu item in OnFileNew, I do this:

CMenuItemInfo mii;

CMenuHandle menu = m_CmdBar.GetMenu();
CMenuHandle submenu = menu.GetSubMenu(0);

mii.fMask = MIIM_DATA;

// I could actually use wID here passed in but I want to test
// the the specific menu item at the moment
if( submenu.GetMenuItemInfo(ID_FILE_NEW,FALSE,&mii) == 0 )
{
// Little helper function
ShowLastError();
}

DWORD dwTestData = mii.dwItemData;

dwTestData is always '0' no matter what I try to set it to.. I can
retrieve the Menu item text and print it out so I know I'm dealing
with the right menu item... I don't know if I am going wrong with
setting the data or retrieving it... It is really driving me nuts,
I feel like I am missing something very obvious here.

Thanks,
Scott

PS.. Here is an example project:
http://www.binaryrevelations.com/menutest.zip


=======================================
: W. Scott Dillman
: Principle Software Engineer
: binaryRevelations Interactive, LLC.
: http://www.binaryrevelations.com
=======================================
GeneralRe: WTL menu driving me nuts... Pin
Todd Smith17-Mar-02 16:20
Todd Smith17-Mar-02 16:20 
GeneralRe: WTL menu driving me nuts... Pin
AlphaDog18-Mar-02 2:46
AlphaDog18-Mar-02 2:46 
General16-Bit Programming Pin
Burnt Toast17-Mar-02 14:28
Burnt Toast17-Mar-02 14:28 
GeneralRe: 16-Bit Programming Pin
Matt Newman17-Mar-02 16:07
Matt Newman17-Mar-02 16:07 
GeneralRe: 16-Bit Programming Pin
Nish Nishant17-Mar-02 16:25
sitebuilderNish Nishant17-Mar-02 16:25 
GeneralHotKey Control Pin
17-Mar-02 13:54
suss17-Mar-02 13:54 
GeneralOnInitDialog question Pin
RK_200017-Mar-02 13:32
RK_200017-Mar-02 13:32 
GeneralRe: OnInitDialog question Pin
Nish Nishant17-Mar-02 13:30
sitebuilderNish Nishant17-Mar-02 13:30 
GeneralLVM_SETITEMTEXT problem Pin
17-Mar-02 9:46
suss17-Mar-02 9:46 
GeneralRe: LVM_SETITEMTEXT problem Pin
Michael Dunn17-Mar-02 12:51
sitebuilderMichael Dunn17-Mar-02 12:51 
Generalnetmeeting Pin
17-Mar-02 8:29
suss17-Mar-02 8:29 
GeneralRe: netmeeting Pin
Michael P Butler17-Mar-02 22:07
Michael P Butler17-Mar-02 22:07 
GeneralHelp with WTSRegisterSessionNotification Pin
17-Mar-02 7:49
suss17-Mar-02 7:49 
GeneralRe: Help with WTSRegisterSessionNotification Pin
Tim Smith17-Mar-02 7:50
Tim Smith17-Mar-02 7:50 
GeneralRe: Help with WTSRegisterSessionNotification Pin
17-Mar-02 8:08
suss17-Mar-02 8:08 
GeneralRe: Help with WTSRegisterSessionNotification Pin
17-Mar-02 8:28
suss17-Mar-02 8:28 
GeneralRe: Help with WTSRegisterSessionNotification Pin
17-Mar-02 8:32
suss17-Mar-02 8:32 

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.