Boost logo

Boost :

From: Martin Schuerch (mschuerch_at_[hidden])
Date: 2002-09-16 06:39:51


When exception.cpp is compiled with Unicode defined in VC7 General Settings,
the following does not compile (LPTSTR is wchar_t*):

# ifdef BOOST_WINDOWS
          LPVOID lpMsgBuf;
          ::FormatMessage(
              FORMAT_MESSAGE_ALLOCATE_BUFFER |
              FORMAT_MESSAGE_FROM_SYSTEM |
              FORMAT_MESSAGE_IGNORE_INSERTS,
              NULL,
              m_err,
              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
              (LPTSTR) &lpMsgBuf,
              0,
              NULL
          );
          m_msg += static_cast<LPCTSTR>(lpMsgBuf);

It works with the following replacements:

FormatMessage -> FormatMessageA
LPTSTR -> LPSTR
LPCTSTR -> LPCSTR

Martin


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk