代码如下:
szFile db MAX_PATH dup(0)
call OpenTxt
invoke CreateFile, addr szFile, GENERIC_READ, FILE_SHARE_READ, NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL
.if eax == INVALID_HANDLE_VALUE
invoke MessageBox,h, addr errormsg, addr msg6, MB_OK
ret
.endif
OpenTxt proc
push hWnd
pop ofn.hWndOwner
push hInstance
pop ofn.hInstance
mov ofn.lStructSize, sizeof ofn
mov ofn.lpstrFilter, offset dlgfilter
mov ofn.lpstrTitle, offset dlgtitle
mov ofn.lpstrFile, offset szFile
mov ofn.nMaxFile, 256
mov ofn.Flags, OFN_LONGNAMES or OFN_OVERWRITEPROMPT
invoke GetOpenFileName, ADDR ofn
ret
OpenTxt endp
------解决方案--------------------------------------------------------
一步步调式吧
------解决方案--------------------------------------------------------
出错码?
------解决方案--------------------------------------------------------
我会变是一点也不东阿
------解决方案--------------------------------------------------------
楼主你调用这两个函数之前的设置都对吧。记得该保存的要保存。