几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】why Cant I Get The Preview Bitmap (http://www.dimcax.com/hust/showthread.php?t=19129)

yang686526 2009-05-07 07:08 PM

【转帖】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


所有的时间均为北京时间。 现在的时间是 04:27 PM.