Awesome. This sounds quite right, though I haven't tested it yet, about to do it now. This is exactly the input I needed. Thanks, you rock.
| 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 |
| [reply] |
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 |
| [reply] [d/l] [select] |