Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 524
  • Last Modified:

Need some help with ON_COMMAND

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
tsp2002
Asked:
tsp2002
  • 5
  • 2
  • 2
1 Solution
 
Maverick_CoolCommented:
there is a fix intellisense vs. apply that patch, I think that should resolve.
0
 
Maverick_CoolCommented:
there is a fix intellisense vs. apply that patch, I think that should resolve.
0
 
tsp2002Author Commented:
"there is a fix intellisense vs. apply that patch, I think that should resolve. "
do you mean an update?
3.BMP
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
tsp2002Author Commented:
0
 
sarabandeCommented:
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
 
tsp2002Author Commented:
"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
 
tsp2002Author Commented:
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
 
sarabandeCommented:
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
 
tsp2002Author Commented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now