file open with long file names
file open with long file names
i am having a weird problem. if i have a file whose location and name is 97 characters long then readfile will work just fine. however, if the location and name is 98 characters long, then readfile melts down. i say "location and name" because this even happens if i strip off the path, change to the directory and do a readfile on just the filename with no path. if i move the file to a directory up the filetree (so the path is shorter) then everything works just fine.
any ideas what i can do?
i am using 14.0.1
hi,
i failed to reproduce it in both odamfcapp and odreadex.
i used 97 and 98-chars paths:
"d:\oda\samples\1234567890123456789012345678901234 567890123456789012345678901234567890\drawing1.dwg"
"d:\oda\samples\1234567890123456789012345678901234 56789012345678901234567890123456789\drawing1.dwg"
it works fine for me with longer paths also.
so could you provide us with more specific information about the problem (could you trace into readfile() function plz)..?
didn't you override findfile() or createfile() of oddbhostappservices ?
i am using the version of dbhostappservices.h that came with 14.0.1 (dated 12/15/2005). i dies inside the call to readfile. the call in question is:
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);
}
it traces into and out of createfile just fine and operator t*() just fine and then dies. the call stack when it dies is:
xrefmgr! odqueryximpl(class oddbfilercontroller const *,class odrxclass const *) + 32 bytes
xrefmgr! oddbfilercontroller::queryx(class odrxclass const *) + 11 bytes
xrefmgr! odqueryximpl(class oddwgfilecontroller const *,class odrxclass const *) + 78 bytes
xrefmgr! oddwgfilecontroller::queryx(class odrxclass const *) + 11 bytes
xrefmgr! odqueryximpl(class oddwgincontroller const *,class odrxclass const *) + 78 bytes
xrefmgr! oddwgincontroller::queryx(class odrxclass const *) + 11 bytes
xrefmgr! odqueryximpl(class oddwgfileloader const *,class odrxclass const *) + 78 bytes
xrefmgr! oddwgfileloader::queryx(class odrxclass const *) + 11 bytes
xrefmgr! oddbdatabase::readfile(class odstreambuf *,bool,class oddbauditinfo *,class odwstring const &,bool) + 393 bytes
xrefmgr! oddbhostappservices::readfile(class odstreambuf *,bool,bool,class odwstring const &) + 86 bytes
oddbhostappservices::readfile(const char * 0x0012eb50, unsigned char 0, unsigned char 0, oda::filesharemode ksharedenyreadwrite, const odwstring & {...}) line 344 + 100 bytes
exhostappservices::readfile(const char * 0x0012eb50, unsigned char 0, unsigned char 0, oda::filesharemode ksharedenyreadwrite, const odwstring & {...}) line 168 + 32 bytes
cxrefmgrdlg::setfileinfo(char * 0x012ed25c, cfileinfo * 0x012ed070) line 713 + 70 bytes
cxrefmgrdlg:

pendocument(const char * 0x012ecd14) line 1144
cxrefmgrdlg:

nopen() line 1217
can you reproduce this in odamfcapp ?
never mind
i figured out that i was running over a message array where i output the name of the file. that in term stomped on other stuff if the file name was long enough. that char array is now a cstring and everything works great. sorry.