SCString str(_T("Hello!"));
USES_CONVERSION;
char* p = T2A(str.GetBuffer(0));
str.ReleaseBuffer();
After searching for a long time, I finally did it with this method. This is Microsoft's ready-made conversion function. This is used when doing mfc and php socket Chinese character transmission.