OS/2, eCS & ArcaOS - Technical > Programming

Filling Comboboxes

(1/3) > >>

Jochen Schäfer:
I have the launcher dialog for PrBoom+ setup with the appended RC file (compiled with WRC) inside the WM_INITDLG call.
I try to fill a combox with LM_INSERTITEM, but the strings are not displayed, while not returning. The code, I use is like this:

--- Code: ---WinSendMsg(launcher.listIWAD, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP((PSZ)iwadname))
--- End code ---
launcher.listIWAD is the handle of the control fetched by WinWindowFromID. iwadname is a char array filled with the display string.
The strange part is that I can fill the command combobox and the files listbox, but not the games and the history comboboxes.
I tried to send the messages by calling WinSendDlgItemMsg or converting the combobox into a listbox. No changes.

Does anyone have a clue, whats going on here?

Lars:
Make sure that all combo boxes have the same attributes in the RC file. Then, you might need to create groups and have that combo box be part of a group.

Jochen Schäfer:
@Lars: Unfortunately, putting the comboboxes in (a) group(s) didn't help. The attributes are all the same.

Lars:
always return TRUE from WM_INITDLG (I do not know why).
You could also call WinUpdateWindow for the whole dialog (that includes its childen) to update all controls before returning from WM_INITDLG.

Other than that I would need to see the full code.

Rich Walsh:
The most likely cause is a dialog-ID mismatch resulting in a null hwnd (or less likely, the wrong hwnd). A null string (i.e. "") is also a possibility. Use an fprintf() immediately before the failing call  to confirm, e.g.


--- Code: ---fprintf(stderr, "hwnd= %x  str= %x - %s\n), launcher.listIWAD, iwadname, (iwadname ? iwadname : "null");

--- End code ---

Run the app using "xxx.exe 2>&1 | tee"

FWIW... there's no need to suplpy a log file name if using GNU 'tee' (unless you want a log).

Navigation

[0] Message Index

[#] Next page

Go to full version