Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Change combobox items

meistrv
ビギナー
508件の閲覧回数
I have this problem.
I use CVF 6.6 and have a win32 - single document application. Within this application I create a dialog with DialogBoxParam function. There are two combo boxes at this dialog. I would like to change the list of items in IDC_COMBO_COMPOUND according to the selection in the IDC_COMBO_FAMILY CB. I have found something similar in the "OWNCOMBO" sample, so i tried it:

CASE(WM_COMMAND)
SELECT CASE (IAND(uParam,16#ffff))
...
CASE (IDC_COMBO_FAMILY)
IF (INT4(HiWord(lParam)) == CBN_SELCHANGE) THEN

iret=GetWindowText(GetDlgItem(hDlg,IDC_COMBO_FAMILY),&
     &Xtext,50)

CALL UpdateIDC_COMBO_COMPOUND(hDlg,Xtext)
...


but it doesn't work.
The condition (INT4(HiWord(lParam)) == CBN_SELCHANGE) is never satisfied. Does anybody know why? Or how to deal the problem?

Thank you for your help

Vit
0 件の賞賛
3 返答(返信)
Jugoslav_Dujic
高評価コントリビューター II
508件の閲覧回数
The condition (INT4(HiWord(lParam)) == CBN_SELCHANGE) is never satisfied. Does anybody know why?

Maybe because docs say that event code is in hiword(wParam), not lParam? ;-)
meistrv
ビギナー
508件の閲覧回数
Thank you for help Jugoslav, of course you are right. As I wrote I have copied and modified a piece of code from the sample "owncombo" (from samplesadvancedwin32) from the source file owncmbod.f90. But there (on lines 389 and 396) is

select case (INT4(HiWord(lParam)))
...
case (CBN_SELCHANGE)


Why? Is it wrong in the sample or has it some special meaning?
Jugoslav_Dujic
高評価コントリビューター II
508件の閲覧回数
Yes, it's an error -- and it doesn't work. lParam for WM_COMMAND always contain control's handle.

I'd note that Murphy's Law works -- of all possible places, you picked up the one with an error :-).
返信