Fancy a challenge ?  Cannot add data to a combo box !

Posted on 2006-05-16
Medium Priority
Last Modified: 2013-11-20
Ah hello.

Please take a look at this project:


I have a simple problem: one dialog - IDD_MY_DLG - containing a combo - IDC_MY_COMBO.  I cannot add data to the combo; the 'data' field in the dialog properties pane of VS.NET 2003 remains disabled/greyed.

Adding a new combo exhibits the same behaviour.

What is going on here ?

Question by:mrwad99
  • 2
LVL 14

Accepted Solution

wayside earned 2000 total points
ID: 16708853
This is a pretty strange problem.

To fix this, try the following:

- If you have the solution open in Visual Studio, close the solution.

- Open up resource.h in wordpad

At the bottom of your resource.h file, you will find a line that looks like this:

#define _APS_NO_MFC                     1

Remove this line from resource.h and save.

- Open the solution back up in Visual Studio, you should now be able to enter text in the data field.

I haven't found any clear description of exactly what effect defining _APS_NO_MFC has.

When you first created the project, what type of project did you select? For an MFC project of any kind, the define should not have been in your resource.h file; it's not in any MFC projects I create from scratch, anyway.
LVL 19

Author Comment

ID: 16717183
*   *   *   *   *   A  B  S  O  L  U  T  E  L  Y       F  A  N  T  A  S  T  I  C !   *   *   *   *   *

Many thanks Wayside; I was going through the solution myself comparing it with a bog standard new dialog app, removing line by line.  But even doing that would not have solved it, because, as you noted, you have to reopen the solution after making the change to see the effect.  I never have thought of doing that for each change I made...

>> When you first created the project, what type of project did you select?

It was a normal MFC project to start with, but I copied some dialogs/resource.h sections from another app.  I then got this problem, and managed to cut it down to the small app that I linked to (and you downloaded) above.

Thanks again, I really appreciate it :o)
LVL 14

Expert Comment

ID: 16717910
You're welcome, glad I could help!

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

862 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