Ashutosh Khale
May 6th, 1999, 01:37 PM
I have a messsage file DLL containing message strings.I am trying to log the description associated with the symbolic names(codes) in my message file,into the application NT EventLog.
Using RegSetValueEx to register the message file under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\MYAPP
RegSetValueEx(hErrorMsgFileSubKey, _T("EventMessageFile"), 0, REG_EXPAND_SZ,
(LPBYTE)aryszBuf, ((_tcslen(aryszBuf) + 1) * sizeof(TCHAR))
To write to application NTEvent Log, I am using the ReportEvent function
ReportEvent(handleToEventSource,1,0,MYCODE_IN_MSGFILE, NULL, 0, 0, NULL, NULL);
ReportEvent function returns SUCCESS,however it is not able to pick the description for my error code MYCODE_IN_MSGFILE,and spits the following text in the event log...
"The description for Event ID ( 2 ) in Source ( MYAPP ) could not be found. It contains the following insertion string(s): ."
GetLastError gives error 203 ie.The system could not find the environment option that was entered. ERROR_ENVVAR_NOT_FOUND
I cannot figure out what it expects.Any leads would be appreciated.
Using RegSetValueEx to register the message file under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\MYAPP
RegSetValueEx(hErrorMsgFileSubKey, _T("EventMessageFile"), 0, REG_EXPAND_SZ,
(LPBYTE)aryszBuf, ((_tcslen(aryszBuf) + 1) * sizeof(TCHAR))
To write to application NTEvent Log, I am using the ReportEvent function
ReportEvent(handleToEventSource,1,0,MYCODE_IN_MSGFILE, NULL, 0, 0, NULL, NULL);
ReportEvent function returns SUCCESS,however it is not able to pick the description for my error code MYCODE_IN_MSGFILE,and spits the following text in the event log...
"The description for Event ID ( 2 ) in Source ( MYAPP ) could not be found. It contains the following insertion string(s): ."
GetLastError gives error 203 ie.The system could not find the environment option that was entered. ERROR_ENVVAR_NOT_FOUND
I cannot figure out what it expects.Any leads would be appreciated.