CString转换成const char*的问题19
发布网友
发布时间:2023-11-03 01:05
我来回答
共2个回答
热心网友
时间:2024-12-05 06:12
CString类里面有一个成员函数
CString::GetBuffer
LPTSTR GetBuffer( int nMinBufLength );
throw( CMemoryException );
Return Value
An LPTSTR pointer to the object’s (null-terminated) character buffer.
Parameters
nMinBufLength
The minimum size of the character buffer in characters. This value does not include space for a null terminator.
于是乎 就可以这样
const char* filename =strAviFilePath.GetBuffer(sizeof(strAviFilePath));
热心网友
时间:2024-12-05 06:13
我也来谢谢你。