News:

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

MASM problem

Started by JayPee, March 07, 2009, 09:57:12 AM

Previous topic - Next topic

JayPee

Hi all

I am trying MASM32 and  I am having trouble with this piece of code, it generate a A2006: undefined symbol : Blue_Brush error but I cant see why.

Any help would be appreciated

.486
.model flat,stdcall
option casemap:none

include PartyPlayer.inc

.data
Blue_Bush DD 0

.data?

PS PAINTSTRUCT <>
.code

Start:

invoke GetModuleHandle,NULL
mov    hInstance,eax
invoke GetCommandLine
invoke InitCommonControls
mov CommandLine,eax
invoke WinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULT
invoke ExitProcess,eax

WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG

mov wc.cbSize,sizeof WNDCLASSEX
mov wc.style,CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc,offset WndProc
mov wc.cbClsExtra,NULL
mov wc.cbWndExtra,DLGWINDOWEXTRA
push hInst
pop wc.hInstance
mov wc.hbrBackground,COLOR_BTNFACE+1
mov wc.lpszMenuName,IDM_MENU
mov wc.lpszClassName,offset ClassName
invoke LoadIcon,NULL,IDI_APPLICATION
mov wc.hIcon,eax
mov wc.hIconSm,eax
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor,eax
invoke RegisterClassEx,addr wc
invoke CreateDialogParam,hInstance,IDD_DIALOG,NULL,addr WndProc,NULL
invoke ShowWindow,hWnd,SW_SHOWNORMAL
invoke UpdateWindow,hWnd
.while TRUE
invoke GetMessage,addr msg,NULL,0,0
 .BREAK .if !eax
invoke TranslateMessage,addr msg
invoke DispatchMessage,addr msg
.endw
mov eax,msg.wParam
ret

WinMain endp

WndProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

mov eax,uMsg
.if eax==WM_CTLCOLORSTATIC
invoke GetDlgItem,hWin,1004
.if eax == lParam
invoke SetBkMode,wParam,TRANSPARENT
invoke SetTextColor,wParam,White
mov eax,Blue_Brush         ;<-----  This line creates error A2006
ret
.endif
Invoke SetTextColor, wParam, 00FF00h
Invoke SetBkColor, wParam, 00h
Invoke GetStockObject, BLACK_BRUSH
ret


.elseif eax==WM_PAINT
Invoke BeginPaint, [hWnd], Addr PS
Invoke EndPaint, [hWnd], Addr PS
ret

.elseif eax==WM_INITDIALOG
push hWin
pop hWnd
invoke CreateSolidBrush,00FF0000h
mov Blue_Brush,eax   ;<-----  This line creates error A2006
ret
.elseif eax==WM_COMMAND
mov eax,wParam
and eax,0FFFFh
.if eax==IDM_FILE_EXIT
invoke SendMessage,hWin,WM_CLOSE,0,0
.elseif eax==IDM_HELP_ABOUT
invoke ShellAbout,hWin,addr AppName,addr AboutMsg,NULL
.endif
; .elseif eax==WM_SIZE
.elseif eax==WM_CLOSE
invoke DestroyWindow,hWin
.elseif uMsg==WM_DESTROY
invoke PostQuitMessage,NULL
.else
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
.endif
xor    eax,eax
ret

WndProc endp

end Start
Greetings From New Zealand
(Land of the Long White Cloud)

Vortex

.data
Blue_Bush DD 0



mov eax,Blue_Brush


jj2007

Check the spelling - it's a typo.

JayPee

Oops!! sorry another senior moment  :P I'm generally very careful about that
Thank you

Cheers
John
Greetings From New Zealand
(Land of the Long White Cloud)