Commit 0761fe51 authored by jan.koester's avatar jan.koester
Browse files

compiles again

parent 6572d112
Loading
Loading
Loading
Loading
+1 −5
Changes for CMakeSettings.json: 1 added line, 5 removed lines.
Original line number Diff line number Diff line
@@ -5,15 +5,11 @@
      "generator": "Ninja",
      "configurationType": "RelWithDebInfo",
      "buildRoot": "${projectDir}\\out\\build\\${name}",
      // Use "installRoot" to define where the project installs files
      "installRoot": "C:/Users/jan.koester/build_blogi/install",
      // The below command line arg is incorrect. Use "cmakeCommandArgs" for general purpose args
      // and "installRoot" for the install prefix specifically.
      "cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Users/jan.koester/build_blogi/install",
      "buildCommandArgs": "",
      "ctestCommandArgs": "",
      "inheritEnvironments": [ "msvc_x64_x64" ],
      // The cache variable below is redundant because installRoot handles the prefix
      "inheritEnvironments": [ "msvc_x64_x64" ]
    }
  ]
}
 No newline at end of file
+4 −6
Changes for src/blogi.cpp: 4 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -838,7 +838,7 @@ int main(int argc, char* argv[]) {
#endif
#ifdef Windows

#define SERVICE_NAME _T("BlogiService") // <-- FIXED: Standard TCHAR definition
#define SERVICE_NAME LPSTR("BlogiService")

SERVICE_STATUS g_ServiceStatus = { 0 };
SERVICE_STATUS_HANDLE g_StatusHandle = NULL;
@@ -859,7 +859,7 @@ VOID LogToEventViewer(WORD type, const std::string& message) {
    // Assuming UNICODE compilation (default for modern Windows services).
    LPCWSTR lpszStrings[1] = { wMessage.c_str() };

    ReportEvent(
    ReportEventW(
        hEventSource,
        type,
        0,
@@ -928,15 +928,13 @@ std::unique_ptr<EventLogStreambuf> g_EventLogCoutStreambuf;

// --- Combined Redirection Function ---
void RedirectStreamsToEventLog() {
    // 1. Redirect std::cerr (Errors)
    g_EventLogCerrStreambuf = std::make_unique<EventLogStreambuf>(EVENTLOG_ERROR_TYPE);
    g_OriginalCerrBuffer = std::cerr.rdbuf();
    std::cerr.rdbuf(g_EventLogCerrStreambuf->rdbuf());
    std::cerr.rdbuf(g_EventLogCerrStreambuf.get());

    // 2. Redirect std::cout (Information)
    g_EventLogCoutStreambuf = std::make_unique<EventLogStreambuf>(EVENTLOG_INFORMATION_TYPE);
    g_OriginalCoutBuffer = std::cout.rdbuf();
    std::cout.rdbuf(g_EventLogCoutStreambuf->rdbuf());
    std::cout.rdbuf(g_EventLogCoutStreambuf.get()); 
}

// --- Combined Restoration Function ---