Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NT Event Logging
Message
From
25/02/1999 22:33:07
 
 
To
25/02/1999 21:42:25
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00191462
Message ID:
00191756
Views:
16
>The NT Event Log logging :) requires a special type of resource in a resource file and this cannot be done from VFP directly. So, a wrapper dll in C/C++ is mandatory. There some good articles (step by step) in MSDN on how to use NT's Event log. In fact, you can create entries in the log event using only the basic log related API functions, but you cannot attach your own messages to each entry.
>
>Vlad
>

Thanks - I made some assumptions based on reading the API call definitions, and assumed that ReportEvent would be doable after performing a RegisterEventSource(), and it looked fairly trivial aside from two of the parameters.

After a quick look, it turns out that it's a nearly trivial task in VB, since the VB App object has a LogEvent method, so a VB-created ActiveX control would be the QUAD method to implement it. I sat down with our office VB wizard, and we knocked out a control in a half-dozen lines of VB that wrote strings into NT's event log; it even handled the situation where you called it under Win95, writing into a file called vbevents.log without having to add any added code to handle the situation.

I guess this means there is a reason for VB to exist!

>>I haven't tried using them from VFP, but you might look into implementing LogEvent() or ReportEvent() from the API. My guess is that you'll have more success with ReportEvent(), although there's more to the API call, it doesn't rely on having a valid resource handle. You'll need something like POINTERS or CLSHEAP to manage the *lpStrings and lpRawData members passed to the API call, and you'd probably be better off writng a C-style .DLL as a wrapper, or implementing an OLE Automation object in C++ or Java (I'd look at VJ++, because of some of the native WFC classes available to access the event log there.)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform