高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】failure in readfile
failure in readfile
failure in readfile
the function mdwgservices.readfile( mtargetfile, false, false, oda::ksharedenyno ); returns an error with code 47 dwg object improperly read using ver 1.14.02 of the library.
the file loads into autocad although the verify command indicates that there are 6 errors.
this same file can be read by odt versions of the library.
regards
gerry
attached files
the file can be loaded and repaired with dwgdirect's recoverfile().
sergey slezkin
thank you - if i had searched only a little through the forum then i would have found similar replies, so apologies for not doing this.
i see that recoverfile () uses an odstreambuf parameter wheras readfile () may use either the odstreambuf or the filename. as odstreambuf must be specifically implemented in every application, and recoverfile () is probably required by the majority of applications at some stage or another, can i suggest that you provide an alternative version of recoverfile() that uses the filename.
regards
gerry
odstreambuf must be implemented in any dd-based application which reads or writes files.
extensions/exservices contains its implementation which can be used in applications or replaced with another one.
btw, from dbhostappservices:
code:
virtual oddbdatabaseptr readfile(
const odchar* filename,
bool allowcpconversion = false,
bool partial = false,
oda::filesharemode sharemode = oda::ksharedenyno,
const odpassword& password = odpassword())
{
oda::fileaccessmode ndesiredaccess = oda::kfileread;
return readfile(odsystemservices()->createfile(filename, ndesiredaccess, sharemode),
allowcpconversion, partial, password);
}
you can easily implement recoverfile() in the same manner.
sergey slezkin
|