Hi
I have a question to GetSaveFileName this crash under xp-sp2
If i remove this
mov @stOF.lpstrDefExt, "txt"
mov @stOF.lpstrCustomFilter,NULL
mov @stOF.nMaxCustFilter,0
works this.
_GetSaveFileName proc uses edi, hWnd:HWND
LOCAL @stOF:OPENFILENAME
invoke RtlZeroMemory,addr @File,sizeof @File
invoke RtlZeroMemory,addr @stOF,sizeof @stOF
mov @stOF.lStructSize,sizeof @stOF
push hWnd
pop @stOF.hwndOwner
mov @stOF.lpstrFilter,offset szSaveFilter
mov @stOF.lpstrFile,offset @File
mov @stOF.nMaxFile,512
mov @stOF.lpstrTitle, offset szBrowseTitle
mov @stOF.lpstrDefExt, "txt"
mov @stOF.lpstrCustomFilter,NULL
mov @stOF.nMaxCustFilter,0
mov @stOF.Flags,OFN_OVERWRITEPROMPT OR OFN_HIDEREADONLY
.if !@File
invoke lstrcpyn,addr @File,CTEXT ("File.txt"),256
.endif
invoke GetSaveFileName,addr @stOF
.if eax
mov eax,@stOF.lpstrFile
.endif
ret
_GetSaveFileName endp
greets
lpstrCustomFilter
Pointer to a static buffer that contains a pair of null-terminated filter strings
One NULL is not enough. This might be one reason for your crash.
EDIT: But mov @stOF.lpstrDefExt, "txt" is another hot candidate. Try
mov @stOF.lpstrDefExt, chr$("txt")
Thanks for your help i try it