解决方法: CString mystr("helloworld"); BSTR mybstr = mystr.AllocSysString(); SysFreeString(mybstr);//用这句释放后,内存泄漏问题解决