查看单个帖子
旧 2009-05-07, 07:08 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】why Cant I Get The Preview Bitmap

why can't i get the preview bitmap?
why can't i get the preview bitmap?
the following is my code :
////////////////////////////////////////////////////////////////////////////
void cpreviewdib::setpreviewfile(lpctstr lpfilename)
{
cstring csfilename(lpfilename);
m_odimage.bmp.clear();
m_odimage.header.clear();
m_odimage.wmf.clear();
if ( ! csfilename.getlength() )
return;
cstring ext = csfilename.right(4);
ext.makelower();
if ( ext == ".dwg" || ext == ".dxf" )
{
odstreambufptr pfile;
odstaticrxobject<myservices> svcs;
svcs.disableoutput(false);//true or false?//1
odinitialize(&svcs);
pfile =svcs.createfile(lpfilename);
try
{
oddbgetpreviewbitmap(pfile, &m_odimage);
}
catch(...)
{
return;
}
}
}
//////////////////////////////////////////////////////////////////////////////////fff">undefined
the result is that m_odimage.hasbmp() ==false.
this function will return the preview only if it exists in the file. but saving preview to dwg or dxf is optional.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)