Author Topic: 64 bit combo box issue..no data showing  (Read 700 times)

mikeburr

  • Member
  • **
  • Posts: 186
64 bit combo box issue..no data showing
« on: June 13, 2022, 09:02:56 PM »
Im having problems (64bit) loading a combo box
Nothing is showing in the boxes despite apparantly loading and incrementing the indices correctly
I'm sure it's a fairly simple explanation ...the edit boxes all show default data fine

a summary of the output

;;;;;;;;;;;;;;;;
combo boxes [ nothing showing in boxes
 
 0h : CB_SETEXTENDEDUI .. A value of TRUE selects the extended user interface.. use arrow or F4
              set to TRUE  .. use arrow
 
 then add string data
 
 index   box        box      data         window  data
(rax)     id       handle   location      handle  inserted

 0h      1520      180A9Eh  148F2583510h  9B0B2Ah Value 1
 1h      1520      180A9Eh  148F2583920h  9B0B2Ah Value 2
 2h      1520      180A9Eh  148F2583D30h  9B0B2Ah Value 3
 0h
 0h      1521      8B15C8h  148F2584140h  9B0B2Ah England
 1h      1521      8B15C8h  148F2584550h  9B0B2Ah France
 2h      1521      8B15C8h  148F2584960h  9B0B2Ah Ireland
 3h      1521      8B15C8h  148F2587230h  9B0B2Ah Italy
 4h      1521      8B15C8h  148F258A750h  9B0B2Ah Scotland
 5h      1521      8B15C8h  148F2589B20h  9B0B2Ah Wales
 0h
 0h      1522      1B0E96h  148F258AF70h  9B0B2Ah Argentina
 1h      1522      1B0E96h  148F2589F30h  9B0B2Ah Australia
 2h      1522      1B0E96h  148F2587690h  9B0B2Ah Fiji
 3h      1522      1B0E96h  148F2587AA0h  9B0B2Ah Japan
 4h      1522      1B0E96h  148F25882C0h  9B0B2Ah New Zealand
 5h      1522      1B0E96h  148F258A340h  9B0B2Ah Samoa
 6h      1522      1B0E96h  148F258AB60h  9B0B2Ah South Africa
.........................
 edit boxes [ these all show fine with a qualification below]
 
 1h  9B0B2Ah  5E5h 9           
 1h  9B0B2Ah  5E6h 0           
 1h  9B0B2Ah  5E7h 9           
 1h  9B0B2Ah  5E8h 0           
 1h  9B0B2Ah  5E9h 0           
 1h  9B0B2Ah  5EAh 0           
 1h  9B0B2Ah  5EBh 0           
 1h  9B0B2Ah  5ECh P 0     [letter P is shown lower case .. shd be upper case .. why ?? ]     
 1h  9B0B2Ah  5EEh Comp Page 0
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
the assembler code
 combo box
   loop start
              mov rdx, WS_BOX_ID
              mov r8, offset genWinHandle16 
              mov rcx, [r8]
              lea rax, [rcx + 1] ; test window handle limit 32 bit eqvt ????
      test    rax, 0FFFFFFFFFFFEFFFFh
      je      GenMakeComboBoxDefaultDataerror             
          call GetDlgItem
      test    rax, rax
      je  GenMakeComboBoxDefaultDataerror
     
          ;  mov rcx, WS_WORKHANDLE ;[this is a stored value the same as rax ]

            mov rcx, rax            ; result of getdlg
            mov r9, GenHdataStructure.GenHDS_data
            add r9, r10_save
            mov r9_save, r9
            mov r8, WC_DATA_COUNT
                        ;  mov r8, -1 ; also teated
            mov rdx, 14Ah             ; CB_INSERTSTRING
                        ;  mov rdx, 151h ; CB_SETITEMDATA  also tested
                        ;  mov rdx, 143h ; CB_ADDSTRING  also tested
     
          call SendMessage
         
    get next pointer [ all working fine]
    retrun to loop
   
 error routine etc
 
[this is effectively the same code as SendDlgItemMessage)
......................
 edit box [ all working fine except odd capital P exception]
 

              mov r8, offset genWinHandle16 
              mov rcx, [r8]
             
              mov rdx, WS_BOX_ID
             
              mov r8, GenHdataStructure.GenHDS_data
              add r8, r10_save
              mov r9,FALSE ; unsigned numbers
          call SetDlgItemText
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
box definitions

combo box

  [ extra style]
      mov rax, WS_EX_ACCEPTFILES
      mov WC_BOX_EX_STYLE, rax 
  [ style] 
      mov rax,CBS_DROPDOWNLIST
      or rax,CBS_HASSTRINGS     
      or rax,CBS_AUTOHSCROLL
      or rax,WS_CHILD
      or rax,WS_OVERLAPPED
      or rax,WS_VISIBLE
      mov WC_BOX_STYLE,rax

.............................

 edit box
   [ extra style]
      mov rax, WS_EX_CLIENTEDGE
      mov WC_BOX_EX_STYLE, rax
  [ style]
      mov rax,ES_LEFT   
      or rax,ES_AUTOHSCROLL
      or rax,WS_CHILD
      or rax,WS_VISIBLE 
      or rax,WS_BORDER
      or rax,WS_TABSTOP
      mov WC_BOX_STYLE,rax

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10297
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: 64 bit combo box issue..no data showing
« Reply #1 on: June 13, 2022, 10:35:04 PM »
Mike,

Just out of curiosity I tried the following code with a combo box and nothing changed.

rcall SendMessage,hCombo,CB_SETEXTENDEDUI,TRUE,0

Add string like this.

        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 1"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 2"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 3"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 4"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 5"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 6"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 7"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 8"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 9"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 10"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 11"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 12"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 13"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 14"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 15"
        rcall SendMessage,hCombo,CB_ADDSTRING,0,"String 16"
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

mikeburr

  • Member
  • **
  • Posts: 186
Re: 64 bit combo box issue..no data showing
« Reply #2 on: June 13, 2022, 11:43:21 PM »
Yes Steve.. thats exactly ( pretty much what I'm doing) and yet although the indexes are showing it loading there's no display..almost the same thing on edit boxes works fine ...I just can't see for looking ..it must be obvious but I'm not getting it ..
There's no point in putting the whole program up as it's bloody enormous ..loads the 16 or so screens and menus from a comma delimited list..the data is also part of this stream and linked to the boxes in each 'dialog' ..its this data being loaded..the data is fine and the method the same for loading edit boxes ..its prob something really trivial
Regards mikeb

jj2007

  • Member
  • *****
  • Posts: 13648
  • Assembly is fun ;-)
    • MasmBasic
Re: 64 bit combo box issue..no data showing
« Reply #3 on: June 13, 2022, 11:45:32 PM »
No complete code, no error checking... good luck :thumbsup:

Full working code attached, source and exe (assembled with ML64) :cool:

Code: [Select]
cbStyle=WS_VISIBLE or WS_CHILD or CBS_DROPDOWNLIST or CBS_HASSTRINGS
ID_COMBO=111
jinvoke CreateWindowEx, WS_EX_CLIENTEDGE, Chr$("combobox"), NULL, cbStyle, 0, 0, 1, 1, hWnd, ID_COMBO, wcx.hInstance, NULL
mov hCombo, rax ; you may need this global variable for further processing
xor rsi, rsi
  @@: jinvoke SendMessage, hCombo, CB_ADDSTRING, 0, Str$("String %i", rsi)
inc rsi
cmp rsi, 20
jb @B

mikeburr

  • Member
  • **
  • Posts: 186
Re: 64 bit combo box issue..no data showing
« Reply #4 on: June 13, 2022, 11:49:07 PM »
Ps I've tried cb_addstring..obviously using 0 subscript..with definition hamstrings etc ..and also without using cb line ( zero based) ..you ed have thought it wasn't finding the link to the data etc..but the op is from displays straight after using the same technique ..so it obviously is..I even tried using fixed data description as a one off..nothing

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10297
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: 64 bit combo box issue..no data showing
« Reply #5 on: June 14, 2022, 12:50:46 AM »
Mike,

Here is a simple demo that should get you going.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

mikeburr

  • Member
  • **
  • Posts: 186
Re: 64 bit combo box issue..no data showing
« Reply #6 on: June 14, 2022, 01:12:04 AM »
Its nothing to do with the code..its the definition of the window..either the registration or create..although it has the look of a combo box
Regards mikeb

jj2007

  • Member
  • *****
  • Posts: 13648
  • Assembly is fun ;-)
    • MasmBasic
Re: 64 bit combo box issue..no data showing
« Reply #7 on: June 14, 2022, 01:45:33 AM »
And all your API invokes always return zero for GetLastError? That is really weird :rolleyes:

mikeburr

  • Member
  • **
  • Posts: 186
Re: 64 bit combo box issue..no data showing
« Reply #8 on: June 14, 2022, 04:53:18 AM »
OK so something bizarre is going on ..I replicated both yours Steve..and jj  create insert..same result ..nothing
I'm using a call  & rsp + etc for the create ( which is generating the window handle correctly )  and the sendmessage is fast call so I can't see where the error is atm
Regards mikeb

mikeburr

  • Member
  • **
  • Posts: 186
Re: 64 bit combo box issue..no data showing
« Reply #9 on: June 14, 2022, 08:16:35 AM »
no the return codes from the sendmessage are the rax column and correspond to the combo box index .. impying its working .. but the combo box even when i hard code in a string as in steves example isnt showing [it ought to appear replicated  on several lines in fact] .. so i copied your definitions etc still no joy... i have a facility in the program to download the box details .. style and extra style etc and everything is fine .. also it cant be the data location etc as i used a display with exactly the same info to get the column results shown .. ive been trying variants of this for 5 days .. its driving me b..y mad
regards mike b
i might have to post the program or rather a cut down version

jj2007

  • Member
  • *****
  • Posts: 13648
  • Assembly is fun ;-)
    • MasmBasic
Re: 64 bit combo box issue..no data showing
« Reply #10 on: June 14, 2022, 08:36:55 AM »
i might have to post the program or rather a cut down version

Yes indeed :thumbsup:

mikeburr

  • Member
  • **
  • Posts: 186
Re: 64 bit combo box issue..no data showing
« Reply #11 on: June 16, 2022, 05:46:42 PM »
OK I've solved it..everything is working as it should..
The reason nothing shows is..
Firstly the combo box definition of size needs to be significantly larger than a single edit box size ..I had defined the box 25 units deep where about 75 minimum is required..
Also nothing shows in the combobox until a selection is made..
If the number of selections exceeds the " units allocated" eg 30 selections but only a small pop up list area defined (75 units) then disablenoscroll and hasstrings are required
A default can be shown in the original box ( this is partly how I found everything working)
The default is shown by first sending the equivalent of a SetDlgItemText..
I this resides in user32.dll and will be found to consist of GetDlgItem followed by  SetWindowText..
So in my instance since I have established the (child) window handle and saved it I simply needed to use SetWindowText first to establish a default
Many thanks for the help ..perseverance pays off
Regards mike b
Ps where the list is longer than the units allocated no scroll bar shows ( unless you ownerdraw and build the box) so using the up down keys are necessary to scroll it ...this maybe seems a bit feeble on the part of the designers  but I can understand why it's simplistic