News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Need Help

Started by mgrie, February 21, 2008, 08:03:01 AM

Previous topic - Next topic

mgrie

Hi

I try fill a TreeViewControl with values i get from a MySQL resultset. The resultset have 3 fields (id, parent, categoryname) and a lot of rows.
When the parent field is 0 the row has inserted as TVI_ROOT in the other case by his parent. The value is stored in st_mysql_field.dwName[ebx+4]
and with:

mov eax, st_mysql_field.dwName[ebx+4]

and
invoke DspString, eax, 0 ;Show a Messagebox with the Value of eax

i get the right value. But the following .if eax==0 will not work.
When i print out the valus of registers, eax is like 020889.
How can i copy the real value into eax ??


A little more code:

invoke mysql_num_fields, dwMyRES
mov dwNumMem, eax
mov tvis.item, 0
; Id in lParam speichern
mov eax, st_mysql_field.dwName[ebx]
mov tvis.item.lParam, eax
; Parent nach eax speichern
mov eax, st_mysql_field.dwName[ebx+4]
; Wenn Parent=0 als TVI_ROOT einfügen
.if eax==0
  mov eax, st_mysql_field.dwName[ebx+8]
  mov tvis.item.pszText, eax
  mov eax, hParent
  mov     tvis.hParent, TVI_ROOT
  mov     tvis.hInsertAfter, TVI_LAST
  invoke SendMessage, dwTreeView, TVM_INSERTITEM, 0, addr tvis
  mov     hParent, eax
.else
  mov eax, st_mysql_field.dwName[ebx+8]
  mov tvis.item.pszText, eax
  mov eax, hParent
  mov     tvis.hParent, eax
  mov     tvis.hInsertAfter,  TVI_LAST
  invoke SendMessage, dwTreeView, TVM_INSERTITEM, 0, addr tvis
  mov     hParent, eax
.endif

mgrie

Ok I find it by myself

mov eax, uval(st_mysql_field.dwName[ebx+4])