C++
enum OpenMode { kForReadAndReadShare = 1, kForReadAndWriteNoShare = 2, kForReadAndAllShare = 3, kTryForReadShare = 4 };
File
dbmain.h
Members
Members | Description |
---|---|
kForReadAndReadShare | Open for read and allow read sharing (same as _SH_DENYWR). Using this value with AcDbDatabase::readDwgFile() gives the same behavior as in previous releases of ObjectARX, and prevents other applications from writing to the file. Also, if the file was already opened by another application for writing, then AcDbDatabase::readDwgFile() will fail. |
kForReadAndWriteNoShare | Open for read/write and allow no sharing (same as _SH_DENYRW). Using this value with AcDbDatabase::readDwgFile() prevents other applications from reading and writing to the file when the file is opened by AcDbDatabase::readDwgFile(). An AcDbDatabase::readDwgFile() call using this mode will fail if any other application has the drawing file open, or if the drawing file is read-only. |
kForReadAndAllShare | Open for read and allow read and write sharing (same as _SH_DENYNO). Using this value with AcDbDatabase::readDwgFile() allows other applications full access to the file when the file is opened by this call. This call will open a file for reading when the same file is already opened for writing.Using this mode with AcDbDatabase::readDwgFile() does not lock out other applications from writing to the file. It is not safe to do a lazy load in such circumstances. Performing a lazy load means that pieces of the drawing are read-in only as needed. This feature, combined with the possibility of other applications updating the drawing file under this mode, can cause inconsistent reads and other errors. So, when AcDbDatabase::readDwgFile() is used with this mode, readDwgFile() will call AcDbDatabase::closeInput() in order to fully read in the file and release the file handle (i.e. no lazy load). without the call to closeInput(). |
kTryForReadShare | This value causes AcDb to first try opening the file using kForReadAndReadShare, and if that fails, then to try again using kForReadAndAllShare. |
Description
This enumerated type provides the mode values used to specify how a database resident object is to be opened.