【发布时间】:2012-08-09 08:16:40
【问题描述】:
经过很长时间的今天,我看到了这种转换:
void SomeFunction( LPCTSTR szText ) ...
CString str;
str.Format( "A Simple Sentence" );
SomeFunction( LPCTSTR( str ) );
编译正常。有关此转换的任何解释?
似乎大部分都可以,因为我不需要使用GetBuffer 并稍后释放它,也不需要创建带有字符串长度的new LPTSTR。
【问题讨论】: