Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Event logging with VFP revisited
Message
From
26/03/2002 09:56:11
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Event logging with VFP revisited
Miscellaneous
Thread ID:
00637226
Message ID:
00637226
Views:
46
This is as far as I got and now I'm stuck:
lcString1='\\SMT002'
lcString2='HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog\Application\WinApp'

DECLARE INTEGER RegisterEventSource IN WIN32API STRING lcString1,STRING lcString2

MyHandle=RegisterEventSource(lcString1,lcString2)

&& The ReportEvent() should be here

DECLARE INTEGER DeregisterEventSource IN WIN32API INTEGER lnHandle
=DeregisterEventSource(MyHandle)
I seem to get a valid handle, because some huge number is returned, and I get a returncode of 1 when I call DeregisterEventSource, so I assume that works as well.

The MSDN Library describes how to call ReportEvent in Win32API as follows-
BOOL ReportEvent(
  HANDLE hEventLog,    // handle to event log
  WORD wType,          // event type
  WORD wCategory,      // event category
  DWORD dwEventID,     // event identifier
  PSID lpUserSid,      // user security identifier
  WORD wNumStrings,    // number of strings to merge
  DWORD dwDataSize,    // size of binary data
  LPCTSTR *lpStrings,  // array of strings to merge
  LPVOID lpRawData     // binary data buffer
);
Parameters
hEventLog 
[in] Handle to the event log. This handle is returned by the RegisterEventSource function. 
wType 
[in] Specifies the type of event being logged. This parameter can be one of the following values. Value Meaning 
EVENTLOG_SUCCESS Success event 
EVENTLOG_ERROR_TYPE Error event 
EVENTLOG_WARNING_TYPE Warning event 
EVENTLOG_INFORMATION_TYPE Information event 
EVENTLOG_AUDIT_SUCCESS Success audit event 
EVENTLOG_AUDIT_FAILURE Failure audit event
Now as far as C/C++ is concerned, I don't know my backside from my elbow, and
my questions here really are:

How do I translate this stuff into a VFP DECLARE-DLL statement?

Which parameter types should I use as seen from VFP?

Which values shoul I pass?

TIA, your help is greatly appreciated.
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Next
Reply
Map
View

Click here to load this message in the networking platform