高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】can only read file once
can only read file once
can only read file once
hi everyone,
the way how i read the file is the following:
code:
class myservices : public exsystemservices, public exhostappservices
{
protected:
odrx_using_heap_operators(exsystemservices);
};
and
code:
class mydwgreader
{
public:
// myservices
odrxobjectimpl<myservices> svcs;
// database
oddbdatabaseptr pdb;
// constructor
mydwgreader()
{
odinitialize(&svcs);
};
// destructor
~mydwgreader()
{
oduninitialize();
};
bool loadfile(const char * filename)
{
pdb = svcs.readfile( filename, false, true, oda::ksharedenyno );
};
};
the only problem is that if i call mydwgreader once to read a file. then i initiate another instance of mydwgreader to read another file, it will not read the second file. now if i have the service defined globally and it is initialized/uninitialized globally, then it can read multiple files. are there any easy way to solve this problem
correct that. it appears that it reads the data, however it lost the entity type. thus, it would always read as default entity rather than going to circle or arc ... when i call pentreader->read(pent, player,ss, doc, scale, lines, &numlines);
am i missing something??
thanks
suming
odinitialize() initializes dd static objects and it must be called once.
before it's called again odunitialize() must be called.
odinitialize()
oduninitialize()
odintialize() - should work
but
odinitialize()
odinitialize() - will not work
sergey slezkin
|