|
[code]void GetCADVersion()
{
//方式一:通过系统变量方式
struct resbuf buf;
if (RTNORM == acedGetVar(_T("ACADVER"), &buf))
{
acutPrintf(_T("\n当前CAD的主版本号:%s"), buf.resval.rstring);
free(buf.resval.rstring);
}
//方式二:通过全局函数
int iMajorVer = acdbHostApplicationServices()->releaseMajorVersion(); //返回主版本号
int iMinorVer = acdbHostApplicationServices()->releaseMinorVersion(); //返回子版本号
acutPrintf(_T("\n当前CAD的主版本号:%d;子版本号:%d"), iMajorVer, iMinorVer);
}
[/code] |
|