I'm making a DLL (especially for Delphi apps) which shall be used as an interface library to my app's data file type.
The read/load/decode functions do work well, but now id like to enahnce it with Write-Functions.
For a better understanding, thats how the basics of my DLL are done:
1. Call InitDBX
This is the Function which initializes my Engine. The Func takes parameters
FileName, 2 PTRs to Buffers and the FileStream-Mode, which is similar to the syntax of TFileSTream.Create.
Eg. that call could look like:
InitDBX('c:\test.dbx', HeaderBuf, SampleBuf, fmOpenRead or fmShareDenyWrite)
Now you could call functions to load dta from the the DBX-File, eg. LoadHeader. As you see, this FileMode would not allow writing to the DBX-File.
So if you do a call to WriteHeader (or anyother function to write data) i want to make sure that you have specified a FileMode which allows writing.
But thats my problem. Even if i save a copy of the FileStream-Mode in a gloval Value, i dunno how to analzy this Word-Value. How can I detect, that we got actually the Permission to write files ?
Regarding the Delphi Help on TFileStream.Create, at least one of the following Constants/Values musrt be included.
fmOpenReadWrite or fmWrite
How to find out if they are given ?