Hi,
I got very strange problem with my C++ code.
One section my code connect to specific page of one website and read one number(for example number 45814). My code working good with all servers but recently I got problem with specific server. When read number from this page shows number "458140" instead "45814". I mean it adds one zero to number. my code is as below:
char* __stdcall Get_Account_Number_FromWEB()
{
std::string strTopic = "get account from web";
const char * szPlimusRef = gpVar->m_strPlimusRef.c_str();
std::string strHttpReq = "http://www.example.com/1.htm";
HINTERNET webHANDLE = InternetOpen(strTopic.c_str(), 0, "0", "0", 0);
HINTERNET webResult = InternetOpenUrlA(webHANDLE, strHttpReq.c_str(), "0", 0, -2080374528, 0);
if ( webResult )
{
char szwebBuffer[1024];
memset(szwebBuffer,0,sizeof(szwebBuffer));
DWORD dwBytes = sizeof(szwebBuffer);
DWORD dwBytesActual = 0;
BOOL bRead = InternetReadFile(webResult, szwebBuffer, dwBytes, &dwBytesActual);
InternetCloseHandle(webResult);
gpVar->m_strWEBDigest = (char*)szwebBuffer;
}
else
{
gpVar->m_strWEBDigest = "No internet connection";
}
InternetCloseHandle(webHANDLE);
return (char*)gpVar->m_strWEBDigest.c_str();
}
When open this page manually I see "45814" but when this function read that shows "458140".
I checked this with different server all works correctly but only one server got this strange problem.
Can anybody solve this problem?
Regards,