The MASM Forum Archive 2004 to 2012

Project Support Forums => MASM32 => Topic started by: Farabi on March 01, 2010, 06:53:04 AM

Title: write_disk_file
Post by: Farabi on March 01, 2010, 06:53:04 AM
I cannot use write_disk_file each time I used OpenFileDialog. The error message is: "Cannot write a file that already opened".
Title: Re: write_disk_file
Post by: MichaelW on March 01, 2010, 08:27:00 AM
If the file is already open, you could use the fwrite macro or call the API WriteFile function directly.
Title: Re: write_disk_file
Post by: Farabi on March 01, 2010, 09:42:08 AM
Quote from: MichaelW on March 01, 2010, 08:27:00 AM
If the file is already open, you could use the fwrite macro or call the API WriteFile function directly.

But, where is the handle?
Title: Re: write_disk_file
Post by: hutch-- on March 01, 2010, 10:35:28 AM
Onan,

write_disk_file is for doing a complete operation in one go, if you need to have a file open and keep writing to it use the fopen or fcreate macros or the API calls they use and when you have finished use the fclose macro.
Title: Re: write_disk_file
Post by: Farabi on March 01, 2010, 11:25:59 AM
Quote from: hutch-- on March 01, 2010, 10:35:28 AM
Onan,

write_disk_file is for doing a complete operation in one go, if you need to have a file open and keep writing to it use the fopen or fcreate macros or the API calls they use and when you have finished use the fclose macro.

I dont know what is wrong with my package, but after I used OpenFileDialog, read_disk_file is not working.
Title: Re: write_disk_file
Post by: Farabi on March 02, 2010, 03:26:03 AM
Sorry miss typed again, after the dialog open the write_disk_file is not working.