This is putting an event in the application log file.

But I don't think it's supposed to bring out Dr. Watson when it's run?

P.S. I thought it was "chicken lips" of M.S. to not properly return the good "Dr." in place of vsjitdebugger.exe when I   
      un-installed Visual Basic C++.  :)

; Report_Event.asm 

INCLUDE    \masm32\include\
include    \masm32\include\
includelib \masm32\lib\advapi32.lib 


Provider_Name  db  "MyEventProvider",0
Failed          db  "RegisterEventSource failed.",0
AppName        db  "SiegeWorks",0
string1        db  "This is a test.",0
string2        db  " "
string3        db  " "


hEventLog      HWND  ?
dwEventDataSize dw    ?



stringpointers label dword
DWORD offset string1
DWORD offset string2
DWORD offset string3

    ;mov , NULL
    push offset Provider_Name
    push NULL
    Call RegisterEventSource
    mov , eax ; copy handle for storage
.IF eax == NULL
  ;invoke GetLastError
  ;invoke wsprintf, addr OutputBuffer, addr Failed, eax
  invoke  MessageBox, NULL, addr Failed, addr AppName, MB_OK

mov , (sizeof stringpointers)

invoke ReportEvent,hEventLog,EVENTLOG_INFORMATION_TYPE,0,0,NULL,3,dwEventDataSize,addr stringpointers,NULL

invoke DeregisterEventSource,hEventLog

invoke ExitProcess, NULL

end start
Posted on 2011-02-06 20:38:01 by skywalker
This attachment is not word for word developer studio.  There are many ways to do the same thing.
Posted on 2011-03-16 17:31:56 by roaknog
Thanks so much.

Posted on 2011-03-17 18:36:44 by skywalker