M
MyCatAlex
Guest
I need a PipeClient-Server pair for my C++ application. To say it is mine is an overstretch, the codes are from the GitHub. This is the Client. While attempting to compile it I get a note that warnings will be treated as errors. I went into the Project Properties and turned it off, besides I turned ALL the warnings off, nonetheless I get two errors after warnings WERE treated as errors. I have VS2017 Community Edition.
In this code slice (CPipeCLient.cpp, line 47 :
void CPipeClient::SetData(std::wstring& sData)
{
memset(&m_buffer[0], 0, AU_DATA_BUF);
//memcpy(&m_buffer[0], sData.c_str(), __min(AU_DATA_BUF, sData.size()));
wcsncpy(&m_buffer[0], sData.c_str(), __min(AU_DATA_BUF, sData.size())); // <== error
}
This ia the error message:
Severity Code Description Project File Line Suppression State
Warning C4996 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. MFCaptureD3D c:\cplusplus_projects\mfcaptured3d\mfcaptured3d\cpipeclient.cpp 47
But when I try to use wcsncpy_s I get another error. This time the Intellisense says that there is no such overload.
How to handle it?
Thanks, - MyCatAlex
Continue reading...
In this code slice (CPipeCLient.cpp, line 47 :
void CPipeClient::SetData(std::wstring& sData)
{
memset(&m_buffer[0], 0, AU_DATA_BUF);
//memcpy(&m_buffer[0], sData.c_str(), __min(AU_DATA_BUF, sData.size()));
wcsncpy(&m_buffer[0], sData.c_str(), __min(AU_DATA_BUF, sData.size())); // <== error
}
This ia the error message:
Severity Code Description Project File Line Suppression State
Warning C4996 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. MFCaptureD3D c:\cplusplus_projects\mfcaptured3d\mfcaptured3d\cpipeclient.cpp 47
But when I try to use wcsncpy_s I get another error. This time the Intellisense says that there is no such overload.
How to handle it?
Thanks, - MyCatAlex
Continue reading...