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 7767071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:35:03+00:00 2026-06-01T15:35:03+00:00

Im sure this question is so easy for all you experts, but I am

  • 0

Im sure this question is so easy for all you experts, but I am new to C++ and trying to add a comboBox to a “Option” Dialog in my program, I have done the following, but still can’t see any item in Combo box can you please tell me what I am missing here.

in Resourse.h : #define IDD_TRIGGER_MODE 201

in Project.rc : COMBOBOX IDD_TRIGGER_MODE, 64,22,68,14,WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWN

any in the .cpp file I have the folliwng codes :

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;

switch (message)
{
case WM_COMMAND:    
    ///Other codes///
        case IDM_OPTIONS:       

    g_hToolbar = CreateDialog(hInst, MAKEINTRESOURCE(IDD_OPTION_BOX), hWnd, ToolDlgProc);
    if(g_hToolbar != NULL)
    {
        ShowWindow(g_hToolbar, SW_SHOW);
    }        
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    break;
///Other codes///
}

the ToolDlgProc function :

INT_PTR CALLBACK ToolDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
 HWND fgModes;

switch (message)
{
case WM_INITDIALOG:
     fgModes = ::GetDlgItem(hDlg, IDD_TRIGGER_MODE);
  fgModes = GetDlgItem(hDlg, IDD_TRIGGER_MODE); 
     if(fgModes!=NULL){
     if(SendMessage(fgModes,CB_ADDSTRING,0, reinterpret_cast<LPARAM (_T("FreeRun")))==NULL){            
        return (INT_PTR)FALSE ;          
     }                  
    return (INT_PTR)TRUE;
     }

case WM_COMMAND:
    if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
    {
        EndDialog(hDlg, LOWORD(wParam));
        return (INT_PTR)TRUE;
    }
    break;
}
return (INT_PTR)FALSE;
}

I appricate it for any idea to solve this problem, Thank you

  • 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-06-01T15:35:05+00:00Added an answer on June 1, 2026 at 3:35 pm

    thank you so much for your help. but I notice I didnt have problem in my code, simply the size of the ComboBox in .rc file was quite small (because of my lack of experiance in c++ API), so I change it to 42 now I can see my items. here is the edited code :

    COMBOBOX IDD_TRIGGER_MODE, 64,22,69,42,WS_CHILD|WS_VISIBLE|CBS_DROPDOWNLIST

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sure this is an easy question, but I don't have an answer for.
I am sure this is an easy question, but one that has escaped me
I'm sure that this is an easy question for JS experts out there. Unfortunately
I'm sure this question HAS to have been asked, but after searching through the
This is an easy question but I am not sure the correct jargon to
I am sure this is a very easy question for many, but I am
I'm sure this is a easy question, my Google-fu is obviously failing me. How
I'm sure this question has been answered before, but I can't find an answer
I'm sure this question is asked a lot but I cannot find an answer
I'm not sure this question is appropriate here but I hope I could get

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.