Solved

Cannot add new events to control

Posted on 2003-11-18
12
176 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 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

17 Experts available now in Live!

Get 1:1 Help Now