title: c++ win32 : adding values to ComboBox
body: <p>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. </p>
  
  <p>in Resourse.h : <code>#define IDD_TRIGGER_MODE       201</code></p>
  
  <p>in Project.rc : <code>COMBOBOX        IDD_TRIGGER_MODE, 64,22,68,14,WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWN</code></p>
  
  <p>any in the .cpp file I have the folliwng codes : </p>
  
  <pre><code>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///
  }
  </code></pre>
  
  <p>the ToolDlgProc function :</p>
  
  <pre><code>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&lt;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;
  }
  </code></pre>
  
  <p>I appricate it for any idea to solve this problem, Thank you</p>