|
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碗,继续卖。说白了,通货膨胀就是,你的钱是挣来的,他的钱是印来的,掺和在一起,你的钱就贬值了。
|