Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7639653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:28:23+00:00 2026-05-31T08:28:23+00:00

Given a resource file, containing a combo box definition, for a C++ MFC program,

  • 0

Given a resource file, containing a combo box definition, for a C++ MFC program, is there a way to programmatically obtain the option strings?

When defining a dialog in the Visual Studio resource editor, one can specify the options with a ;-delimited string. Where are these strings then stored? I understand as well that one can programmatically add strings to the dialog box during dialog init, obtaining them is another story.

Nevertheless, my problem is that I don’t have access to the dialog object, neither is it visible at the time I wish to obtain the option strings. Is that even possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:28:25+00:00Added an answer on May 31, 2026 at 8:28 am

    You can create a member variable for combobox or

    CComboBox* pBoxOne;
    pBoxOne = (CComboBox*) GetDlgItem(IDC_COMBO1);
    
      CString str, str2;
      int n;
      for (int i=0;i < pBoxOne->GetCount();i++)
      {
        n = pBoxOne->GetLBTextLen( i );
        pBoxOne->GetLBText( i, str.GetBuffer(n) );
        str.ReleaseBuffer();
    
        str2.Format(_T("item %d: %s\r\n"), i, str.GetBuffer(0));
        afxDump << str2;
       }
    

    The option strings are stored in the resource file itself. I have added options as 1;2;3 and the resource file entries are

    IDD_MFC_DIALOG_DIALOG DLGINIT
    BEGIN
        IDC_COMBO1, 0x403, 2, 0
    0x0031, 
        IDC_COMBO1, 0x403, 2, 0
    0x0032, 
        IDC_COMBO1, 0x403, 2, 0
    0x0033 
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to determine whether there is a resource file for the given CultureInfo
Given a pack:// URI, what's the best way to tell whether a compiled resource
Is there a way to count how many entries there are in a given
Given a table of logical resource identifiers (one per row), what is the best
Here is my error: Warning: mysql_query() expects parameter 2 to be resource, null given...
Given, Apache Maven 3.0.3 and a src/main/resources/application.properties file with project.root=${basedir} and a pom.xml file
Given: - an assembly (e.g. SomeLib.dll) - a text file (e.g. myconfig.xml) I need
How can I delete the MAINICON resource entry in exe file(s)? Instead of changing
error: No resource found that matches the given name (at 'background' with value '@drawable/mydroidbg.png').
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.