贴一份资料供参考:
=================
若将CString类转换成char*(LPSTR)类型,常常使用下列三种方法:
方法一,使用强制转换。例如:
CString theString( "This is a test" );
LPTSTR lpsz =(LPTSTR)(LPCTSTR)theString;
方法二,使用strcpy。例如:
CString theString( "This is a test" );
LPTSTR lpsz = new TCHAR[theString.GetLength()+1];
_tcscpy(lpsz, theString);
需要说明的是,strcpy(或可移值Unicode/MBCS的_tcscpy)的第二个参数是 const wchar_t* (Unicode)或const char* (ANSI),系统编译器将会自动对其进行转换。
方法三,使用CString::GetBuffer。例如:
CString s(_T("This is a test "));
LPTSTR p = s.GetBuffer();
// 在这里添加使用p的代码
if(p != NULL) *p = _T('\0');
s.ReleaseBuffer();
// 使用完后及时释放,以便能使用其它的CString成员函数
分享到:
相关推荐
Oracle9208 RAC+MCSG11.15+HPUX11iV1
HPUX 11iv3 系统管理员指南 LVM管理手册
hpux 11iv3 training ppt
hpux11.23安腾配置操作系统镜像详细说明和步骤
HP-UX System Administrator's Guide: Logical Volume Management for HP-UX 11i Version 3
开源跨平台XML解析器-LIBXML2--库-hpux 11/ia64,源代码可从http://xmlsoft.org/downloads.html或资源“开源跨平台XML解析器-LIBXML2--C源代码及VC6工程文件”获取
# fbackup –f /dev/rmt/0m -0iv / -I /tmp/sysbk.index -f : 设备文件名 ( such as DDS tape driver) -i : 要包含的目录 -e: 不包含的目录 - I: 备份内容检索目录 - v: 备份内容详细列表 - 0 : 零级备份 ...
Purpose of the Exam Prep Guide The intent of this guide is to set expectations about the content and the context of the exam and to help candidates prepare for the exam. In this guide, you ...
1、机型 #model 2、cpu个数 #top 3、硬盘的大小信息 #diskinfo /dev/rdsk/c1t0d0 4、硬盘的个数 #ioscan -funC disk . . .
在HPUX11i平台下安装Oracle 10gR2(10.2.0.1).pdf
HPUXsysinfo 脚本,获取HPux操作系统的各种信息。
QT4.4.1和log4cpp在hpux 11iV3下的安装编译全过程。
HPUX命令查询手册2HPUX命令查询手册2HPUX命令查询手册2
hpunix系统zabbix客户端介质,网上好不容易找到的资源,亲测可用。
...
...
hpux11.31 IA平台下的openssh6.6的depot包。
Oracle Database 21c 是最新的版本; 21.3 - 企业版(也包括标准版 2) 适用于HP-UX ia64系统。HPUX.IA64_213000_db_home文件分割成 四个 压缩包,必须集齐 四个 文件后才能一起解压一起使用: Oracle Database 21c...
HPUX在线扩充文件系统
在hpux 11.23 中安装oracle rac 10g 手册。