Uploaded image for project: 'Qt Solutions'
  1. Qt Solutions
  2. QTSOLBUG-4

Registering a QtService as a message source

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: Release 5
    • Fix Version/s: Some Release
    • Component/s: Service
    • Labels:
      None

      Description

      When writing messages via logMessage, then the Windows Event Viewer usually displays:

      The description for Event ID ( 0 ) in Source (...) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: [actual message]

      To avoid that, and to only have the message itself displayed, the following steps have to be taken:

      a) Create a dummy.mc file like this:

      LanguageNames=(English=0x409:MSG00409)

      MessageId=0x1
      Severity=Error
      SymbolicName=MSG_BAD_COMMAND
      Language=English
      %1
      .

      b) Compile that dummy.mc file into a resource file:

      mc dummy.mc

      c) Add the resource file to your project:

      RC_FILE = dummy.rc

      d) Register the service executable as the message source by adding a registry key:

      HKLM/System/CurrentControlSet/Services/Eventlog/Application/[Service Name]/EventMessageFile

      That entry needs to point to the executable.

      Steps a/b/c could be handled by the service.pri file. Step d could be performed by the service's self-installing routine.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            vhilshei Volker Hilsheimer
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes