Changeset 1374

Show
Ignore:
Timestamp:
05/28/08 03:58:48 (6 months ago)
Author:
timdewhirst
Message:

OAL
- remove dependency on atlbase.h

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/openassetlib/al/al.cpp

    r1347 r1374  
     1/* -*- mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */ 
    12// al.cpp 
    23// 
     
    1314#include <openassetlib/al/base64_codec.hpp> 
    1415 
     16// opl 
     17#include <openpluginlib/pl/utf8_utils.hpp> 
     18namespace pl = olib::openpluginlib; 
     19 
    1520#if defined( WIN32 ) && !defined( USE_LIBXML2 ) 
    16 #import <msxml6.dll> 
    17 #pragma warning( disable : 4290 ) 
    18 #include <atlbase.h> 
     21# import <msxml6.dll> 
     22# pragma warning( disable : 4290 ) 
     23# ifdef UNICODE 
     24pl::string tchar_to_string( const TCHAR* ct )  
     25{ 
     26        // TCHAR should actually be a wchar_t here 
     27        return pl::to_string( pl::wstring( static_cast< const pl::wstring::value_type* >( ct ) ) ); 
     28} 
     29# else 
     30#  error "UNICODE must be defined" 
     31# endif 
    1932#else 
    20 #include <libxml/tree.h> 
    21 #include <libxml/parser.h> 
     33# include <libxml/tree.h> 
     34# include <libxml/parser.h> 
    2235#endif 
    2336 
     
    441454                        catch(_com_error& e) 
    442455                        { 
    443                                 std::cout << "Exception (_com_error): " << CT2CA(e.ErrorMessage()) << std::endl; 
     456                                std::cout << "Exception (_com_error): " << tchar_to_string( e.ErrorMessage() ).c_str() << std::endl; 
    444457                                return false; 
    445458                        } 
     
    531544                        catch(const _com_error& e) 
    532545                        { 
    533                                 std::cout << "Exception (_com_error): " << CT2CA(e.ErrorMessage()); 
     546                                std::cout << "Exception (_com_error): " << tchar_to_string( e.ErrorMessage() ).c_str() << std::endl; 
    534547                                return set_ptr(); 
    535548                        }