Hello, would like to give data in com port (one has she pours sends always) and on the screen visible do. However, does not go. Please, around help.

With one gropes (PushButton ( IDM_COM) ? I am a beginner when i push with mouse read from com port !


nBits DWORD 1000

;hComm dw ? ; f?r den COM - Port
hComm HANDLE ? ; com handle

.start

mov dcb.BaudRate,38400
mov dcb.ByteSize,8
mov dcb.Parity,0
mov dcb.StopBits,1


.data
dcb DCB <> ; The structure
Com2 db "com2",0 ; com1, LPT1 .... etc ; f?r den COM Port !!!

ClassName db "Win32ASMEditClass",0




.elseif ax==IDM_COM ; -===== lesen von com port
; mov ofn.Flags, OFN_FILEMUSTEXIST or \
; OFN_PATHMUSTEXIST or OFN_LONGNAMES or\
; OFN_EXPLORER or OFN_HIDEREADONLY
; invoke GetOpenFileName, ADDR ofn
; .if eax==TRUE
; mov ofn.Flags,OFN_LONGNAMES or\
; OFN_EXPLORER or OFN_HIDEREADONLY
; invoke GetSaveFileName, ADDR ofn ; file erzeugen
; .if eax==TRUE

invoke CreateFile,ADDR Com2,\
GENERIC_READ or GENERIC_WRITE,\
;FILE_SHARE_READ or FILE_SHARE_WRITE,\
NULL,\
NULL,OPEN_EXISTING,NULL,\
NULL
; invoke CreateFile,ADDR buffer,\ ; erzeugt das open-file menu
; GENERIC_READ or GENERIC_WRITE ,\
; FILE_SHARE_READ or FILE_SHARE_WRITE,\
; NULL,OPEN_EXISTING,FILE_ATTRIBUTE_ARCHIVE,\
; NULL
mov hComm,eax; Get the Handle
; mov hFile,eax

invoke GlobalAlloc,GMEM_MOVEABLE or GMEM_ZEROINIT,MEMSIZE ; definiert speicher
mov hMemory,eax
invoke GlobalLock,hMemory
mov pMemory,eax
invoke SendMessage,hwndEdit,WM_GETTEXT,MEMSIZE-1,pMemory
; ? ;invoke ReadFile,hComm,pMemory,MEMSIZE-1,ADDR nBits, NULL; SizeReadWrite,NULL
; ? ;invoke ReadFile,hFile,pMemory,MEMSIZE-1,ADDR SizeReadWrite,NULL
; ? ;invoke SendMessage,hwndEdit,WM_SETTEXT,NULL,pMemory
invoke CloseHandle,hFile
invoke GlobalUnlock,pMemory
invoke GlobalFree,hMemory
; .endif
invoke SetFocus,hwndEdit
Posted on 2004-01-22 15:06:04 by vaquero