Here is the code I am trying to compile in Visual Studio 2017.
#include "stdafx.h"
#define _WINSOCKAPI_
#include <httpserv.h>
#include "json.h"
#include "json-forwards.h"
#include <iostream>
#include <fstream>
HRESULT
__stdcall
RegisterModule(DWORD dwServerVersion, IHttpModuleRegistrationInfo * pModuleInfo, IHttpServer * pGlobalInfo)
{
UNREFERENCED_PARAMETER(dwServerVersion);
UNREFERENCED_PARAMETER(pGlobalInfo);
bool alive = true;
MyGlobalModule * pGlobalModule = new MyGlobalModule;
if (NULL == pGlobalModule)
{
return HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
}
while (alive) {
Json::Reader reader;
Json::Value root;
std::ifstream push_manifest("push_manifest.json", std::ifstream::binary);
bool parsingSuccessful = reader.parse(push_manifest, root, false);
if (!parsingSuccessful)
{
// report to the user the failure and their locations in the document.
std::cout << reader.getFormatedErrorMessages()
<< "\n";
}
std::string encoding = root.get("encoding", "UTF-8").asString();
std::cout << encoding << "\n";
alive = false;
}
return pModuleInfo->SetGlobalNotifications(
pGlobalModule, GL_PRE_BEGIN_REQUEST);
}
Getting the below Errors while compiling.Please suggest what is wrong since the errors don't explain anything.