I'm trying to convert STD:: basic_string<TCHAR> to LPCTSTR. It works, but the result ends at the first space in the original string.
I know the conversion works because I output="Camera". If I replace all the spaces with underscores then the entire thing works. I suppose that's acceptable, but is there any way to get the spaces?Code:basic_string<TCHAR> strOutput; basic_stringstream<TCHAR> buff; buff << "Camera pos: ("<<camerax<<", "<<cameray<<", "<<cameraz<<")"; buff>>strOutput; output=(LPCTSTR)strOutput.c_str();
(or a better way to convert? I still need to be able to add string versions of my variables easily, like with the stringStream above, which automatically converts my floats to strings)
Note: the reason I'm doing this is so I can send output to the directx LPD3DXFONT->DrawText() function. Is it possible that this function just doesn't like spaces?



LinkBack URL
About LinkBacks



