Using const_cast<LPTSTR> with LVM_INSERTCOLUMN
I think the following code is quite safe because LVM_INSERTCOLUMN does not modify the string which pszText points to:
const std::string columnHour = loadString(IDS_LOGGING_HEADER_HOUR);
LVCOLUMN column;
ZeroMemory(&column, sizeof(column));
column.mask = LVCF_TEXT | LVCF_WIDTH;
column.cx = 64;
LPARAM columParam = reinterpret_cast<LPARAM>(&column);
// Note:
// We can use const_cast here because the content of
// pszText is not modified durning LVM_INSERTCOLUMN.
// Insert logging control column 'Hour':
column.pszText = const_cast<LPTSTR>(columnHour.c_str());
myLoggingListView.sendMessage(LVM_INSERTCOLUMN, 0, columParam);
Or should I copy the text into an std::vector instead?

