当前位置: 代码迷 >> 汇编语言 >> 瞅罗云彬那本书第四章的程序编写出错
  详细解决方案

瞅罗云彬那本书第四章的程序编写出错

热度:162   发布时间:2016-05-02 04:34:30.0
看罗云彬那本书第四章的程序编写出错
提示几个错误 请给位大牛讲解讲解
.386
.model flat,stdcall
option casemap:none

include <windows.inc>
include <user32.inc>
includelib <user32.lib>
include <kernel32.inc>
includelib <kernel32.lib>
include <gdi32.inc>
includelib <gdi32.lib>

.data?
hInstance dd ?
hWinMain dd ?

.const
szClassName db 'My Class',0
szCaptionMain db 'My first Window!',0

_ProcWinMain proc

_ProcWinMain endp

_WinMain proc
local @stWndClass:WNDCLASSEX

invoke GetModuleHandle,NULL
mov hInstance,eax

invoke  RtlZeroMemory,addr @stWndClass,sizeof @stWndClass
invoke LoadCursor,0,IDC_ARROW
mov @stWndClass.hCursor,eax
push hInstance
pop @stWndClass.hInstance
mov @stWndClass.cbSize,sizeof WNDCLASSEX
mov @stWndClass.style,CS_HREDRAW or CS_VREDRAW
mov @stWndClass.lpfnWndProc,offset _ProcWinMain
mov     @stWndClass.hbrBackground,COLOR_WINDOW + 1
mov @stWndClass.lpszClassName,offset szClassName
invoke RegisterClassEx,addr @stWndClass

invoke CreateWindowEx,WS_EX_WINDOWEDGE,offset szClassName,\
offset szCaptionMain,WS_OVERLAPPEDWINDOW,100,100,500,500,\
NULL,NULL,hInstance,NULL

mov hWinMain,eax
invoke ShowWindow,hWinMain,SW_SHOWNORMAL
invoke UpdateWindow,hWinMain

_WinMain endp

start:
call _WinMain
invoke ExitProcess,NULL

end start
------解决方案--------------------
这个,是有些绕,你在代码之前漏了 .code 语句。
  相关解决方案