In a MFC project, I have encoutnered an issue using CDatabase::ExecuteSQL method, whend I have tried to deliver a std::string as a parameter:
void ExecuteSQL(LPCTSTR lpszSQL);
std::string sql;
ExecuteSQL(sql.c_str());
in Use Unicode Character Set configuration only.
The error is:
'void CDatabase::ExecuteSQL(LPCTSTR)': cannot convert argument 1 from 'const _Elem *' to 'LPCTSTR'
note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
So, which one of conversion is better ? reinterpret_cast or C-style cast ? Or doesn't matter ?