It is more likely that the error message relates to the call to SetWindowText. The mention of LPCWSTR (a Windows data type) indicates that this is happening in a UNICODE build where SetWindowText is resolved to SetWindowTextW for which a LPCWSTR is the second parameter. Consequently, since title.c_str() returns a const char* pointer the error is issued.
So 1)build for ascii/mbcs or 2) use std::wstring or 3) convert the std::string data to UNICODE.