Solved

Need some help with ON_COMMAND

Posted on 2011-03-21
9
510 Views
Last Modified: 2013-11-20
Hello,
I tried to add a ON_COMMAND to a menue point to CMainFrame.
When I make a right click to the menue point to add a COMMAND the Visual will
hang-up and I have to break down Visual.

If I do it manual everything works fine.
Can you help me with that?

500 points.
Best regards,
Thomas
Visual Studio .NET 2003 Service Pack 1
I did this manual....everything works.



MainFrm.h 
afx_msg void OnWarenbegleitscheineDialog();




MainFrm.cpp
ON_COMMAND(ID_LIEFERSCHEINE_WARENBEGLEITSCHEINE,OnWarenbegleitscheineDialog)

void CMainFrame::OnWarenbegleitscheineDialog()
{
	CLieferscheine_Dialog *pMeinDialog;
	pMeinDialog = new CLieferscheine_Dialog;
	pMeinDialog->mb_Kennzahl_first_show_up=true;
	pMeinDialog->ShowWindow(SW_SHOW);
}

Open in new window

1.BMP
2.BMP
0
Comment
Question by:tsp2002
  • 5
  • 2
  • 2
9 Comments
 
LVL 7

Expert Comment

by:Maverick_Cool
ID: 35179618
there is a fix intellisense vs. apply that patch, I think that should resolve.
0
 
LVL 7

Expert Comment

by:Maverick_Cool
ID: 35179628
there is a fix intellisense vs. apply that patch, I think that should resolve.
0
 

Author Comment

by:tsp2002
ID: 35180064
"there is a fix intellisense vs. apply that patch, I think that should resolve. "
do you mean an update?
3.BMP
0
 

Author Comment

by:tsp2002
ID: 35180120
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 33

Expert Comment

by:sarabande
ID: 35181912
i wonder whether an update will fix that. it looks more that you somehow corrupted your source in mainfrm.cpp

do you got the ON_COMMAND statement inserted into a message map definition? i mean like

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
         //{{AFX_MSG_MAP(CMainFrame)
  ....
   ON_COMMAND(ID_LIEFERSCHEINE_WARENBEGLEITSCHEINE,OnWarenbegleitscheineDialog)
         //}}AFX_MSG_MAP
END_MESSAGE_MAP

if not or if the //{{AFX_MSG_MAP is somehow corrupted your problems could come from that.

if you are not sure you might create a totally new MFC SDI project and take the mainframe.cpp from there. then add line by line from your current code.

Sara
           
0
 

Author Comment

by:tsp2002
ID: 35188246
"do you got the ON_COMMAND statement inserted into a message map definition? i mean like "
no...it will hanp-up here....at this window


4.BMP
0
 

Author Comment

by:tsp2002
ID: 35188288
one strange thing just happend.
I have added another menue point and added a ON_COMMAND like my picture above 4.BMP
and everything works just fine?????
0
 
LVL 33

Accepted Solution

by:
sarabande earned 500 total points
ID: 35188810
if the wizard hangs it is probably because it has problems to parse your mainfrm.cpp and mainfrm.h. it needs to find some keywords like //{{AFX_MSG_MAP where it could add new entries.

i assume you once made changes to one of those parts by accident.

if it works now your manual changes to the sources may have "repaired" the sources.

to make sure that it is corrected the best way would be to take those sources from another project and add the individual parts again.

Sara
0
 

Author Closing Comment

by:tsp2002
ID: 35188975
i assume you once made changes to one of those parts by accident....yes I think so too.
Thank you Sara
Have a great day.
Best regards,
Thomas
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
EvenOdd challenge 10 90
FizzBuzz challenge 9 77
matchUp  challenge 9 94
ASP.NET C# MessageBox.Show Showing a modal dialog box or form when the application ... 2 104
The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now