Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to write to the event log - How to?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00588684
Message ID:
00588699
Views:
36
>>>Can somebody please tell me the steps I have to take to write messages to the NT/2000 event log.
>>>
>>>I'm not very well versed in API stuff, so if you have an example or two I'd be truly grateful.
>>>
>>>TIA
>>
>>If the Windows Script Host is an option, see MSKB#Q257541. It shows how to write to the log from within VFP.
>
>
>Hi George,
>
>Well, yes and no- does it come with NT 4.0 & Win2K and is it installed by default?

On Win2K yes. Check on the September, 2000 issue of the VFUG newsletter for information on NT. It's the first of the five part series of article Ed Rauh and I wrote regarding the WSH. In it you'll find the answer to NT 4.0, plus how to check for its presence.

>I have tried the code in the above example and it works fine, except the source is given as WSH, and it would be nice if it were MyApp instead.
>
>Another question: If one had access to a DLL where this functionality is implemented, how is such a DLL loaded and it's methods called from VFP?
>
>Is it in fact possible to do that?

There's a series of functions connected with Event Logging in the Platform SDK. The two that'll be of initial interest are: RegisterEventSource() and ReportEvent(). You can find these and others documented either in the MSDN Library or at the MSDN web site.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform