我从一个MYSQL数据库中读出数据到MFC工程中,调试的时候查看row数组数据都是正确的,但是InsertItem和SetItemText函数的时候却出现的乱码
while(row=mysql_fetch_row(result)){
str.Format(_T("%d"),row[0]);//读int型数据
GetListCtrl().InsertItem(i,str);
str.Format(_T("%d"),row[1]);//读smallint型数据
GetListCtrl().SetItemText(i,1,str);
str.Format(_T("%s"),row[2]);//读char型数据
GetListCtrl().SetItemText(i,2,str); i++;
}
其中MFC工程和MYSQL数据库字符集都是Unicode
while(row=mysql_fetch_row(result)){
str.Format(_T("%d"),row[0]);//读int型数据
GetListCtrl().InsertItem(i,str);
str.Format(_T("%d"),row[1]);//读smallint型数据
GetListCtrl().SetItemText(i,1,str);
str.Format(_T("%s"),row[2]);//读char型数据
GetListCtrl().SetItemText(i,2,str); i++;
}
其中MFC工程和MYSQL数据库字符集都是Unicode
解决方案 »
- 请问:我的VC6.0编译环境没法生成ActiveX控件
- 取得文件夹下选中文件的路径?
- 连续调用二次DoModal对话框,第二次有问题.
- 四行代码 Win2k +Vc6.0 下竟然出错:Unhandled exception in Scanf%s.exe:0xC0000005:Access Violation.
- 如何得到一个文件夹下包含子目录与文件的数量和
- 一个既简单又难的问题??
- 高分在线等高手:如何将FormView中的ListCtrl控件充满整个视图?!!!!
- CAJ文件用什么打开
- 讨论一个问题
- C#会替代VC++吗?
- 对话框如何响应 OnKeyDown事件
- 请问:COM组件中指针释放问题
MYSQL_ROW row;