(http://images.cjb.net/5a0d4.gif)
I want to use a MessageBox to prompt the Width&Height of the BITMAP i use ,but it give me weird output(http://images.cjb.net/c5699.gif) i searched the Web and found the bitmap.bmWidth is a LONGĀ data type , 8-bytes long. is there exists a trick to handle this kind of problem
LONG is actually 4 bytes, a DWORD. To show it in a MessageBox, you need one of the dword2Ascii functions, for example the str$(eax) macro.
include \masm32\include\masm32rt.inc
.code
start: invoke GetTickCount
push eax
invoke Sleep, 500
invoke GetTickCount
pop ecx
sub eax, ecx
MsgBox 0, str$(eax), "Milliseconds:", MB_OK
exit
end start
Quote from: jj2007 on March 30, 2012, 07:30:35 AM
LONG is actually 4 bytes, a DWORD. To show it in a MessageBox, you need one of the dword2Ascii functions, for example the str$(eax) macro.
include \masm32\include\masm32rt.inc
.code
start: invoke GetTickCount
push eax
invoke Sleep, 500
invoke GetTickCount
pop ecx
sub eax, ecx
MsgBox 0, str$(eax), "Milliseconds:", MB_OK
exit
end start
:U