毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> 开发语言 >> 正文

masm中资源和代码怎么个链接起来

更新时间:2012-12-18:  来源:毕业论文

masm中资源和代码怎么个链接起来
文件.asm
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.386
.model flat,stdcall
option casemap:none

include      windows.inc
include      kernel32.inc
includelib   kernel32.lib
include      user32.inc
includelib   user32.lib


IDD_DIALOG    equ    1

.data?
hInstance     dd     ?

.const
szText        db     '你点击了确定!',0
szCaption     db     '提示!',0

.code
_ProcWinMain proc uses ebx ecx esi edi,hWnd,uMsg,wParam,lParam
    mov eax,uMsg
.if eax == WM_CLOSE
    invoke EndDialog,hWnd,NULL
.elseif eax == WM_COMMAND
    mov eax,wParam
movzx eax,ax
.if eax == IDC_BTN_OK
    invoke MessageBox,NULL,addr szText,addr szCaption,MB_OK
.elseif eax == WM_INITDIALOG
invoke LoadIcon,hInstance,IDI_APPLICATION
invoke SendMessage,hWnd,WM_SETICON,ICON_BIG,eax
.elseif eax == IDC_BTN_CLOSE
    invoke EndDialog,hWnd,NULL
.endif
.else
    mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
_ProcWinMain endp


start:
      invoke GetModuleHandle,NULL
  mov hInstance,eax
  invoke DialogBoxParam,hInstance,IDD_DIALOG,NULL,offset _ProcWinMain,NULL
  invoke ExitProcess,NULL
  end start
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

资源文件:
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include "resource.h"
#define IDD_DIALOG                      1
#define IDC_BTN_OK                      1000
#define IDC_BTN_CLOSE                   1001
#define IDC_STATIC                      -1

IDD_DIALOG DIALOG   0, 0, 187, 94
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 10, "System"
BEGIN
    LTEXT           "win32汇编测试",IDC_STATIC,67,16,58,12
    PUSHBUTTON      "确定",IDC_BTN_OK,33,50,48,16
    PUSHBUTTON      "取消",IDC_BTN_CLOSE,102,50,48,16
END
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


MakeFile文件
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
NAME = DialogWinow
OBJS = DialogWinow.obj
RES  = DialogWinow.res

LINK_FLAG = /subsystem:windows
ML_FLAG = /c /coff

$(NAME).exe: $(OBJS) $(RES)
Link $(LINK_FLAG) $(OBJS) $(RES)

.asm.obj:
ml $(ML_FLAG) $<
.rc.res:
rc $<

clean:
del *.obj
del *.res
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


编译链接的时候说找不到:
IDC_BTN_CLOSE和IDC_BTN_OK
这个是为什么啊?

源文件中缺少

IDC_BTN_OK        equ              1000
IDC_BTN_CLOSE     equ              1001

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。