I don't want to use it, but in case it helps anyone, I found that in XP (and probably newer Windows versions), there is a binary in SYSTEM32 called eventcreate.exe that will write to the EventLog with a custom source name without the same error I've been getting. This is an example usage: eventcreate /ID 1 /L APPLICATION /SO MyAppName /T INFORMATION /D "This is a test entry in the EventLog."

And extending on the idea of using eventcreate.exe, you can use it in a different way: using it as the source of your EventLog messages in the registry. Here is what works for me (import into registry after modifying your app name:

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Applica +tion\MyAppName] "EventMessageFile"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52 +,00,6f,\ 00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00 +,32,00,\ 5c,00,45,00,76,00,65,00,6e,00,74,00,43,00,72,00,65,00,61,00,74,00,65 +,00,2e,\ 00,65,00,78,00,65,00,00,00 "TypesSupported"=dword:00000007 "CustomSource"=dword:00000001

While I ask a lot of Win32 questions, I hate Windows with a passion. That's the problem with writing a cross-platform program. I'm a Linux user myself. I wish more people were.
If you want to do evil, science provides the most powerful weapons to do evil; but equally, if you want to do good, science puts into your hands the most powerful tools to do so.
- Richard Dawkins

In reply to Re^3: Write to Win32 Event Log, get "/AUXSOURCE=" error by wilsond
in thread [fixed] Write to Win32 Event Log, get "/AUXSOURCE=" error by wilsond

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.