Delphi uses outputdebugstring to debug programs and write system logs
Procedure increment (Sender: tobject); begin outputdebugstring ('ddddddd'); increment ('11'); end; Procedure increment (Sender: tobject); var evtsrchand: thandle; evtmsg: string; P: pointer; I: integer; Size: integer; Q: ^ byte; begin // register the event source with a name. This name is the 'source' column of the event list. // you can determine whether the event is successful. // Be sure to log off evtsrchand: = registereventsource (nil, 'test Project'); If evtsrchand = 0 thenbeginshowmessage ('event source registration failed! '); Exit; end; // record a string here // This string is displayed in the position selected in the second figure below. Evtmsg: = 'record string'; reportevent (evtsrchand, eventlog_information_type, 0, 0, nil, 1, 0, @ evtmsg, nil); // a piece of memory is recorded here, size size: = 32; // apply for getmem (p, size); Q: = P; // fill in this memory for I: = 0 to size-1 dobeginq ^: = I; Inc (Q); end; // The memory content is recorded here. The size is size, and the first byte pointer P // also has the description message msgevtmsg: = 'record a block of memory '; reportevent (evtsrchand, eventlog_information_type, 0, 0, nil, 1, size, @ evtmsg, P); freemem (p); // deregister the event source deregistereventsource (evtsrchand); end.