MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite
.386
.model flat,stdcall
option casemap:none
Viewer proto :DWORD,:DWORD,:DWORD,:DWORD
;
;
SaveBmp proto
include bmp.inc
.code
start:
include variables.inc
pixel_offset struct
;
;
.code
.data
ClassName db "BmpView",0
;
;
;
lPixel dw 3
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\gdi32.inc
include \masm32\include\comctl32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\comctl32.lib
.data?
hInstance dd ?
Quote from: dedndave on May 21, 2012, 12:00:54 PMcan you send me a sample bitmap with that problem yahoo-email:xia_han@yahoo.cn
however, the program crashes if i try to open certain bmp files
not sure why that is, but it may be something to do with accessing addresses in the heap that aren't allocated
Quote from: dedndave on May 21, 2012, 12:00:54 PMwhat do you mean
i would just work on general "clean-up"
.elseif uMsg == WM_ERASEBKGND
.if hbmp
mov eax,1
jmp @f
.endif
xor eax,eax
xor eax,eax
jmp def
...
.else
def:
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
A equ B
B equ C
C equ D
D equ 2
A equ B
B equ A
INVOKE GetProcessHeap
mov hHeap,eax
INVOKE HeapAlloc,hHeap,<Flags>,<BytesRequired>
mov hBlock,eax
INVOKE HeapFree,hHeap,NULL,hBlock