Do anyone knows how to save a struct into a file :confused: , i'm playing with the tut 12 of iczelion and i can?t get this think work, thanks:alright:
Posted on 2003-01-02 12:40:18 by Tempus
Is Something like that.

mystruct struct
data1 db 256 dup(?)
data2 dd 0
data3 dw 256 dup(?)
mystruct ends

.data
ms mystruct <>
ofn OPENFILENAME <>
FiltStr db "XXX Files",0,"*.XXX",0,0
String db 256 dup(0)
hFile dd 0
SizeData dd 0

.code
;YOU CODE HERE
mov ofn.lStructSize,SIZEOF ofn
push hWnd
pop ofn.hwndOwner
push hInstance
pop ofn.hInstance
mov ofn.lpstrFilter, ADDR FiltStr
mov ofn.lpstrFile,ADDR String
mov ofn.Flags,OFN_EXPLORER or OFN_HIDEREADONLY or OFN_LONGNAMES
mov ofn.nMaxFile,256
invoke GetSaveFileName,ADDR ofn
.if (eax!=0)
invoke CreateFile,ADDR String,GENERIC_READ or GENERIC_WRITE,\
FILE_SHARE_READ or FILE_SHARE_WRITE,NULL,CREATE_NEW,\
FILE_ATTRIBUTE_ARCHIVE,NULL
mov hFile,eax
invoke WriteFile,hFile,ADDR ms,SIZEOF mystruct,ADDR SizeData,NULL
invoke CloseHandle,hFile
.endif
Posted on 2003-01-07 15:36:46 by Tempus