CString(LPCTSTR)转为VARTYPE类型

该代码段展示了如何从LPCTSTR类型的字符串中解析并转换成VARTYPE类型。通过比较输入的类型字符串与预定义的VARTYPE类型字符串,如'Boolean', 'Byte', 'Float'等,返回对应的VARTYPE枚举值。如果找不到匹配的类型,则返回VT_EMPTY。" 129665192,9999484,Docker容器部署详解,"['容器技术', 'Docker部署', '运维', '镜像', '系统进程']
摘要由CSDN通过智能技术生成

VartypeFromString(LPCTSTR lpszType)
{
 VARTYPE vtType;
 
 // Compare input type string with supported types and return the
 // corresponding variant type.  (A match is found when lstrcmpi returns
 // zero.)  If specified type is not supported, then return VT_EMPTY.
 // These strings must match those used below in StringFromVartype().
 if (lstrcmpi (lpszType, _T("Boolean")) == 0)
  vtType = VT_BOOL;
 else if (lstrcmpi (lpszType, _T("Byte")) == 0)
  vtType = VT_UI1;
 else if (lstrcmpi (lpszType, _T("Byte Array")) == 0)
  vtType = VT_UI1 | VT_ARRAY;
 else if (lstrcmpi (lpszType, _T("Char")) == 0)
  vtType = VT_I1;
 else if (

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

读万卷书不如行万里路呀

您的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值