搜索
bottom↓
回复: 4

error C2664——vc2013(没有软件板块,暂发这里了)

[复制链接]

出0入0汤圆

发表于 2015-1-6 10:40:13 | 显示全部楼层 |阅读模式

A***********************
// Get/Save a parameter value
#define GETP1(p1, i1, data)     i1 = Get(p1, #i1, data)
#define PUTP1(p1, i1)           Put(p1, #i1, i1)
B**************************

    CString Get(LPCTSTR profile, LPCTSTR entry, LPCTSTR def);
    int Get(LPCTSTR profile, LPCTSTR entry, int def);
    BOOL Put(LPCTSTR profile, LPCTSTR entry, LPCTSTR def);
    BOOL Put(LPCTSTR profile, LPCTSTR entry, int def);


CString CSCommon::Get(LPCTSTR profile, LPCTSTR entry, LPCTSTR def)
{
return(theApp.GetProfileString(profile, entry, def));
}
   
int CSCommon::Get(LPCTSTR profile, LPCTSTR entry, int def)
{
return(theApp.GetProfileInt(profile, entry, def));
}
BOOL CSCommon::Put(LPCTSTR profile, LPCTSTR entry, LPCTSTR def)
{
return(theApp.WriteProfileString(profile, entry, def));
}
   
BOOL CSCommon::Put(LPCTSTR profile, LPCTSTR entry, int def)
{
return(theApp.WriteProfileInt(profile, entry, def));
}
C*******************************

void CSCommon::LoadProfile()
{
GETP1(regP5Comm, SCAEnabled, 0x00);

GETP1(regP5Comm, (LPCTSTR)SockAddr, 0xFF00A8C0);
GETP1(regP5Comm, (LPCTSTR)CurrentInterface, 0x01);
GETP1(regP5Comm, (LPCTSTR)ComPort, 0x01);

// plot type
GETP1(regP5Comm, isScaleLog, FALSE);        //TRUE=log, FALSE=linear, default=FALSE
GETP1(regP5Comm, isPlotLine, FALSE);        //TRUE=line, FALSE=solid, default=FALSE

}

void CSCommon::SaveProfile()
{
PUTP1(regP5Comm, SCAEnabled);

PUTP1(regP5Comm, SockAddr);
PUTP1(regP5Comm, CurrentInterface);
PUTP1(regP5Comm, ComPort);

// plot type
PUTP1(regP5Comm, isScaleLog);
PUTP1(regP5Comm, isPlotLine);
}


D*************************
VC2013环境下,
“int CSCommon::Get(LPCTSTR,LPCTSTR,int)”: 无法将参数 2 从“const char [18]”转换为“LPCTSTR”

E**************************
问题如下:
1、详细的相关代码如上,问题如D,怎么解决?谢谢

阿莫论坛20周年了!感谢大家的支持与爱护!!

你熬了10碗粥,别人一桶水倒进去,淘走90碗,剩下10碗给你,你看似没亏,其实你那10碗已经没有之前的裹腹了,人家的一桶水换90碗,继续卖。说白了,通货膨胀就是,你的钱是挣来的,他的钱是印来的,掺和在一起,你的钱就贬值了。

出0入0汤圆

 楼主| 发表于 2015-1-8 14:56:21 | 显示全部楼层
今天过来看看有没有高手能够帮忙解决,谢谢大家了。

出0入0汤圆

发表于 2015-2-17 23:59:44 | 显示全部楼层
我也是新手;在网上看见的现学现卖;不知道是不是这样。
你的代码是VC6上的,现在用的是vc2013 。
首先打开解决方案:工具栏->项目->属性-》配置属性-》字符集-》使用多字节字符集;

出0入8汤圆

发表于 2015-2-18 00:39:58 | 显示全部楼层
直接转义一下就行了。这种问题哪需要啥高手,是因为你水平有待提高

出0入0汤圆

 楼主| 发表于 2015-3-26 15:53:20 | 显示全部楼层
多谢楼上批评。
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-10-3 02:16

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表