Solved

Cannot add new events to control

Posted on 2003-11-18
12
184 Views
Last Modified: 2013-11-20
Dear All,

when i open the dialog editor and try to add new events to a control it just does not work. the caption "Events..." in the context menu does not activate. even when i want to follow up an already existing event by double klicking the control, this does not work.

where could the problem be?

does anybody have a clue how this error can happen?

Thanks a lot for your help!

Lorenz
 



 
 
0
Comment
Question by:lorenzociripenso
12 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9769927
One possibility is that you have a workspace with multiple projects in it.  The wizard only seems to work (by me - VC++ 6) with the currently active project.  If the dialog is in another project then you would need the setactiveproject command in the class view to switch projects.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9769931
Alternatively delete the clw file for the project.  Class wizard will recreate it for you when you use it.
0
 

Author Comment

by:lorenzociripenso
ID: 9770176
Thank you, but i couldn't solve the problem with your advice.

I'using VC++ 6.0 as well.
I have just one project in my workspace.
I deleted and recreated the clw file just before, because I had a similar occurency as Sanad78 in http://beta.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20704682.html

I think it could be related to my resource.h file, which is quite messy. Is there a way to rebuild it?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9770434
I can't believe a messy resource.h would cause this problem.  If by rebuild you mean renumber I don't know of any way apart from by hand.

Try the rebuild all option in the build menu.  Maybe it will help.

If you have many ID's not used there is a command 'Resource Symbols' that will show you all the ID's defined in the resource.h and where they are used.  You can then select the unused ones and delete them form that utility.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9773457
If deleting the clw file does not help, you may have to remove all VS created files (ncb opt plg) to clean up your project. I have to do this every now and then so that Visual Studio "plays nice" again.

I use a bunch of Perl scripts to clean up and renumber my resource.h files if they get too messy.
0
 

Author Comment

by:lorenzociripenso
ID: 9776236
I did not yet mention that i have about 200 controls one single dialog. is it possible that this is to much for my little VC++? Is there a limit in putting controls in a dialog?
0
 

Author Comment

by:lorenzociripenso
ID: 9776259
By deleting the (.ncb .opt .plg) files i get an error and I have to restore them to get my program to the previous state.

It is also quite strange that the events handler works in other dialogs. that makes me realy think that I have overloaded my dialog.

I have about 90 event handlers in there. that shouldn't be too much!?

0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9776805
I don't know of any limit to the number of controls on a dialog.  However with a large number of controls it just gets confusing for the user (Property sheet + pages more suitable?).

In your .h file for that dialog are all the event handlers together such as

      // Generated message map functions
      //{{AFX_MSG(CxxxDlg)
      afx_msg void OnClose();
      afx_msg void OnBtnNew();
      afx_msg void OnUpdateBtnNew(CCmdUI* pCmdUI);
      afx_msg void OnBtnSave();
      afx_msg void OnUpdateBtnSave(CCmdUI* pCmdUI);
      //}}AFX_MSG
0
 

Author Comment

by:lorenzociripenso
ID: 9777563
OK, people. I didn't manage to resolve the problem. I startet from my latest version and applied all my new changes to that one step by step. Now it works.

I don't know what was the problem with the other one, but for shure there was something wrong with the ClassWizard...

Thank You all for your Help!

And nice greetings from Thailand!

Lorenz
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 11984780
PAQed, with points refunded (125)

Computer101
E-E Admin
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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