arx吧 关注:32贴子:64
  • 1回复贴,共1

利用acedTrans()函数,进行UCS, WCS, DCS之间的相互转换

只看楼主收藏回复

利用acedTrans()函数,进行UCS, WCS, DCS之间的相互转换
int pt_trans( TCHAR *tmode, struct resbuf* ent1_210, struct resbuf* ent2_210, int status, ads_point ptin, ads_point ptout )
{   
     struct resbuf    *from=NULL, *to=NULL;
     int              fret;
     if( !_tcsicmp( tmode, _T("UtoW") ) )                 
     {
         from = ads_buildlist( RTSHORT, 1, RTNONE );
         to    = ads_buildlist( RTSHORT, 0, RTNONE );
         fret = ads_trans( ptin, from, to, status, ptout );
     }
     else if( !_tcsicmp( tmode, _T("WtoU") ) )            
     {
         from = ads_buildlist( RTSHORT, 0, RTNONE );
         to    = ads_buildlist( RTSHORT, 1, RTNONE );
         fret = ads_trans( ptin, from, to, status, ptout );
     }
     else if( !_tcsicmp( tmode, _T("EtoE") ) )            
     {
         fret = ads_trans( ptin, ent1_210, ent2_210, status, ptout );
     }
     else if( !_tcsicmp( tmode, _T("EtoU") ) )            
     {
         to    = ads_buildlist( RTSHORT, 1, RTNONE );
         fret = ads_trans( ptin, ent1_210, to, status, ptout );
     }
     else if( !_tcsicmp( tmode, _T("EtoW") ) )            
     {
         to    = ads_buildlist( RTSHORT, 0, RTNONE );
         fret = ads_trans( ptin, ent1_210, to, status, ptout );
     }
     else if( !_tcsicmp( tmode, _T("UtoE") ) )            
     {
         from = ads_buildlist( RTSHORT, 1, RTNONE );
         fret = ads_trans( ptin, from, ent2_210, status, ptout );
     }
     else if( !_tcsicmp( tmode, _T("WtoE") ) )            
     {
         from = ads_buildlist( RTSHORT, 0, RTNONE );
         fret = ads_trans( ptin, from, ent2_210, status, ptout );
     }
     if ( from ) ads_relrb( from );
     if ( to )    ads_relrb( to );
     return fret;
}   



IP属地:江苏1楼2010-04-08 18:25回复


    IP属地:越南2楼2013-07-19 03:50
    回复