用MFC调用动态链接库,写一个字符串逆序的小程序

程序内容如上,我的链接库中写的逆序函数是用string的,但MFC框架的编辑框的数据类型是CString,
所以一直报如下错误,E:\VC\dlltest\dlltestDlg.cpp(226) : error C2664: 'SetDlgItemTextA' : cannot convert parameter 2 from 'class std::basic_string,class std::allocator >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
希望懂的人能够看看,非常感谢!图片说明图片说明

字符转化的问题解决了,但程序一运行完,就直接崩了,不知为何。。图片说明图片说明

 SetDlgItemText(IDC_EDIT6, reverse(str).c_str())

string 转cstring 要string.c_str()

string 转cstring 要string.c_str()

点击重试,看下堆栈调用窗口,找到自己的函数调用地方,看下对应的代码