OWL: How to put data in combo box on Main Window Dialog?

OWL: How to put data in combo box on Main Window Dialog?

Post by Jeff Garz » Fri, 23 Jul 1993 23:00:55

For some reason, I cannot put any sort of data in a combo box on my
main window dialog.  I've tried setting the transfer buffer, and
creating a TComboBoxData object.  I've tried sending it
SendDlgITemMessage CB_ADDSTRING.  And I've tried the below example.
None seem to work.  Any clues, anyone?

TMainWindow::TMainWindow(PTWindowsObject AParent, LPSTR ATitle)
                         : TDialog(AParent, ATitle)
  char s1[81];

  Editec_UserName = new TEdit(this, ec_UserName, 0);
  Editec_UserID = new TEdit(this, ec_UserID, 0);
  if (!(CBoxcb_UserServer = new TComboBox(this, cb_UserServer, 0)))
    BWCCMessageBox(HWindow, "cannot create combo box", "error", MB_OK);

Ever notice that even the busiest people are never too busy to tell you
just how busy they are.


1. Modeless dialog as main program window & Combo Boxes

        I'm fairly green when it comes to straight Win32 programming, so maybe
the answer to my problem is fairly simple.

My WinMain calls CreateDialog to create a modeless dialog. I then ShowWindow
and UpdateWindow to display the dialog. Finally, I start the message loop:
        while (GetMessage(hWnd, &msg, 0, 0) > 0) {

Inside the DlgProc if the message is a WM_COMMAND I check the LOWORD(wParam) to
see if the exit button (or close-window button on the dialog frame) has been
clicked. I then call PostQuitMessage(0) and return FALSE from the DlgProc.

This works well.

I've added several controls to the dialog box: static controls, edit controls,
buttons, and list controls. When I add a combo box control to the dialog box,
things stop working properly. If you click the combo box the dialog "hangs."
The list portion of the combo doesn't show, and the only way to regain control
of the dialog is to bring another application to the foreground and then bring
the dialog back up... and even then, I may have to click the Exit button a few
times to fix the problem.

Anybody know what my trouble is? If you want, I can send the code from my


Jonathan Zimmerman

2. Trident driver (old&new) question (8514 spec.)

3. OWL question: display a login dialog box before main window shows

4. TrueType font corruption on PC

5. BC++ 4.51 OWL vs Auto Radio Buttons in Main Window Dialog Boxes

6. Black_Hardware_Cellebration: Painting White Hardware ------> Is It Possible?

7. Dialog box as main window, how to in Windows 3.1?

8. BC4:OWL: Putting resource controls in a non-dialog window?

9. BC++ & OWL, How to call main window fcn from dialog

10. OWL: How to fix dialog-main-window-with-menu trash problem?

11. ANSWER: How to center an OWL dialog as main window