查看单个帖子
旧 2009-05-06, 04:23 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】isemr90 wont ever return true, even on known ae files

isemr() won't ever return true, even on known ae files
isemr() won't ever return true, even on known ae files
hi.
i've just started using dwgdirect to access a file in order to see if it has the infamous "made with an educational version" stamp. i'm currently just modifying the singledoc example that comes with dwgdirect, but i intend to expand this app into an available (free) utility to scan entire directory structures recursively. i want there to be an easy utility to check an entire set of project folders for "tainted" files.
i'm using isemr(), a simple "is the databse made with an educational product" function that simply returns true or false; it's part of a oddbdatabase object.
i have checked a known "infected" ae file (it comes up in autocad2005 as educational), and isemr() says it's not ae.
i know that version 1.1 was to have fixed a bug where this function ran but was not actually implemented in the source code. as such, i kind of expected this function to work.
here's the admittedly simple code for those who'd like to see it. it occurs at the end of the view's "oninitialupdate" function, and is checked everytime i open a dwg file.
if (getdocument()->m_pdb->isemr())
{
messagebox("this file was created with an education version of autocad!");
}
any suggestions?
-matt
can you attach a file?
vladimir
yes, open/attach oddb seems ok...
yes, i'm using most all of the default code from the singledoc example project, which, after opening a dwg file, displays it in the app's window.
the "known infected" files that i'm opening do display properly (there are no xref's directly involved), so it does appear that the open/attach process is working fine.
-matt
here's the file opening /attach code (pretty staright forward):
-----------------------------------------------------------
try
{
m_pdb = theapp.readfile(lpszpathname, false, false);
}
catch(oderror& /*e*/)
{
}
catch(userbreak)
{
return false;
}
--------------------------------------------------------------
i mean - can you post to forum a file created in education version, that does not get recognized as such? (for which isemr() returns false)
vladimir
example educational file for testing isemr()
the following url will direct you to an example file that does print with the "educational stamp" warning when plotted (look at a preview). when opened in autocad 2005, you also receive two noticable warnings that you are working with an educational-created dwg file.
-matt
isemr() returns true for this file. what dd version are you using?
vladimir
dd version
apologies for the delay in my response: you had asked what version i was using since my isemr() returned false and yours returned true on the same file.
i'm using dwgdirect ver 2.02, as returned by the function versionstring(), though i thought it was the 2.20 (most recent as march2007).
-matt
2.02 is the same as 2.2
i tested isemr with 2.2, and, in any case, the coresponding code is trivial, and did not change for years. isemr is just a flag stored in dwg - there is no way to treat it somehow incorrectly
this is isemr code:
code:
bool oddbdatabase::isemr() const
{
return m_pimpl->m_educationalplotstamp != 0;
}
and this is how it is read:
code:
pdbimpl->m_educationalplotstamp = rdint32(); // educational plot stamp if != 0 (>=vac15)
vladimir
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)