Joined: 24 Aug 2004
Location: The total perspective vortex
For the first "working" code, you are sending a full 32-bit value (eax) to SendDlgItemMessage, but only 8 of those bits came from modbus_cfg.bVariant, the other 24 bits came from whatever was in eax before. It is only "working" because the return value from SendDlgItemMessage leaves eax with the higher 24-bits as zero.
The second fails because you load the entire dword from memory, but some of those bits are from outside the single byte you wanted and contain other non-zero values in the higher 24 bits.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum