关于在窗口间传递数据问题
本帖最后由 zmx13 于 2022-7-23 09:05 编辑send.asm源码编译出错:
以下为send.asm源码:
.386
.model flat,stdcall
option casemap:none
include C:\masm32\include\windows.inc
include c:\masm32\include\user32.inc
include c:\masm32\include\kernel32.inc
includelib c:\masm32\lib\user32.lib
includelib c:\masm32\lib\kernel32.lib
.data
hWnd dd ?
szBuffer db 256 dup (?)
(15)stCopyData db COPYDATASTRUCT <>
.const
szMes db 'Hello',0
szCaption db 'Send',0
szStart db 'send:按下ok按钮发送消息,参数param是 %08x',0
szReturn db 'send:消息已经发送。',0
szDestClass db 'MyClass',0 ;目标窗口的窗口类
szText db 'send:recv?',0
szNotFound db 'send:没有找到接收窗口',0
.code
start:
invoke FindWindow,addr szDestClass,NULL
.if eax
mov hWnd,eax
invoke wsprintf,addr szBuffer,addr szStart,addr szText
invoke MessageBox,NULL,offset szBuffer,addr szCaption,MB_OK
(36)mov stCopyData.cbData,sizeof szText
(37)mov stCopyData.lpData,offset szText
invoke SendMessage,hWnd,WM_COPYDATA,0,addr stCopyData
invoke MessageBox,NULL,offset szReturn,addr szCaption,MB_OK
.else
invoke MessageBox,NULL,offset szNotFound,addr szCaption,MB_OK
.endif
invoke ExitProcess,NULL
end start
nmake编译出错如下(拼写没出错):
send.asm(36) : error A2006: undefined symbol : cbData
send.asm(37) : error A2006: undefined symbol : lpData
send.asm(15) : error A2020: identifier not a record : COPYDATASTRUCT
NMAKE : fatal error U1077: 'ml' : return code '0x1'Stop
已解决
页:
[1]