How is it possible to convert a 'string' variable to a 'LPCTSTR' variable?
Posted on 2001-08-07
In my program I need to perform various 'string' operations to create a specific string. Afterwards, this string needs to be used in a function which takes a 'LPCTSTR' parameter.
How can I convert the 'string' into a variable of type 'LPCTSTR'?
The assingment I'm attempting looks like this:
pstrLocalFile = StringFileName;
The error I'm getting is:
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >