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

Posted on 2006-05-16
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
    LVL 14

    Accepted Solution

    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

    *   *   *   *   *   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

    You're welcome, glad I could help!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    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…
    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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 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

    10 Experts available now in Live!

    Get 1:1 Help Now