I'm trying to fill 3 combo boxes with 4 strings from a resource. It all works just fine as long as I don't include this line: invoke SendMessage,temp,CB_ADDSTRING,addr buffer,30 Also when I click the combo box the list won't drop down. Is this behaviour normal ? I've been looking at the code for quite while now trying to figure out what's wrong. Maybe someone can help me out:
The program crashes saying: the process "read" could not be applied to the memory. This message was edited by goofee, on 5/22/2001 8:17:01 AM
.const IDS_RESTART equ 1 IDS_SHUTDOWN equ 2 IDS_LOGOFF equ 3 IDS_FORCE equ 4 IDC_COMBOLEFT equ 3010 IDC_COMBOMIDDLE equ 3011 IDC_COMBOHKEY equ 3012 .data? buffer db 30 dup(?) temp dd ? i dd ? count db ? .code ;WndProc .ELSEIF uMsg==WM_INITDIALOG invoke SetFocus,wParam mov count,0 .WHILE count<=4 inc count xor eax,eax mov al,count mov temp,eax invoke LoadString,hInstance,temp,addr buffer,30 mov i,0 .WHILE i<=2 mov eax,IDC_COMBOLEFT add eax,i mov temp,eax invoke GetDlgItem,hDlg,temp mov temp,eax ;invoke SendMessage,temp,CB_ADDSTRING,addr buffer,30 inc i .ENDW .ENDW
as for the dropdown list not showing, search the msgboard, it's been answered. and for the CB_ADDSTRING:
i rest my case. p.s. this temp stuff isn't need either. SendDlgItemMessage. This message was edited by fresh, on 5/22/2001 8:41:42 AM
CB_ADDSTRING wParam = 0; // not used; must be zero lParam = (LPARAM) (LPCTSTR) lpsz; // address of string to add invoke SendMessage,temp,CB_ADDSTRING,addr buffer,30
Well, that was fast. Thanks. Should have asked sooner. I been trying for about 5 hours.