Click here to Skip to main content
15,914,220 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Standard C++ string class maximum length Pin
toxcct10-May-05 4:58
toxcct10-May-05 4:58 
GeneralRe: Standard C++ string class maximum length Pin
James R. Twine10-May-05 5:57
James R. Twine10-May-05 5:57 
GeneralRe: Standard C++ string class maximum length Pin
tysh10-May-05 19:01
tysh10-May-05 19:01 
Generalwindows serial driver problem with 76800 baud Pin
Member 195078810-May-05 2:29
Member 195078810-May-05 2:29 
GeneralActiveX CCheckListControl Pin
Andy H10-May-05 1:52
Andy H10-May-05 1:52 
GeneralCompilation Errors C2143 & C2059 Pin
jignatiu10-May-05 1:46
jignatiu10-May-05 1:46 
GeneralRe: Compilation Errors C2143 & C2059 Pin
RChin10-May-05 1:52
RChin10-May-05 1:52 
GeneralRe: Compilation Errors C2143 & C2059 Pin
jignatiu10-May-05 1:56
jignatiu10-May-05 1:56 
This is the line.

HRESULT LogNTEvent(const LONG lSeverity, const CString & sAppName, const CString & sVersion, const CString & sFile, const LONG lLine, const LONG lErrorCode, const CString & sMsg1, const LONG lPassingCode, const CString & sMsg2);


the implementation for it is given below:
HRESULT LogNTEvent(const LONG lSeverity, const CString &sAppName, const CString &sVersion, const CString &sFile, const LONG lLine, const LONG lErrorCode, const CString &sMsg1, const LONG lPassingCode, const CString &sMsg2)
{
HRESULT hResult = S_OK;
IEVEventLog* pIEventLog = NULL;
long lMySeverity = 1;

if ( 0 <= lSeverity && 4 >= lSeverity )
lMySeverity = lSeverity;

// Write to debug trace log
CString sTraceMsg0;
sTraceMsg0.Format( L"Filename %s: Line=%x, ErrorCode=%x, Message=%s, Method=%s, Passing=%d\n", sFile, lLine, lErrorCode, sMsg1, sMsg2 ,lPassingCode );
TRACE( sTraceMsg0 );

hResult = CoCreateInstance( __uuidof( EVEventLog ), NULL, CLSCTX_ALL, __uuidof( IEVEventLog ), (void**)&pIEventLog );
if ( FAILED( hResult ) )
return ((DWORD)0xC000110DL);

BSTR bsAppName = SysAllocString( L"Vigilance" );
BSTR bsFileName = sFile.AllocSysString();
BSTR bsFuncName = sMsg1.AllocSysString();
BSTR bsMethod = sMsg2.AllocSysString();

hResult = pIEventLog->LogEvent( bsAppName, ((WORD)0x0000000AL), lErrorCode, bsFileName, bsFuncName, lLine, bsMethod, lPassingCode, NULL, NULL);
pIEventLog->Release();
SysFreeString( bsAppName );
SysFreeString( bsFileName );
SysFreeString( bsFuncName );
SysFreeString( bsMethod );
if ( FAILED( hResult ) )
return ((DWORD)0xC000110DL);

return S_OK;

}
GeneralRe: Compilation Errors C2143 &amp; C2059 Pin
David Crow10-May-05 2:50
David Crow10-May-05 2:50 
GeneralRe: Compilation Errors C2143 &amp; C2059 Pin
Maximilien10-May-05 1:55
Maximilien10-May-05 1:55 
GeneralRe: Compilation Errors C2143 &amp; C2059 Pin
jignatiu10-May-05 2:00
jignatiu10-May-05 2:00 
GeneralXP Buttons on non grey backgrounds Pin
Jörgen Sigvardsson10-May-05 1:44
Jörgen Sigvardsson10-May-05 1:44 
GeneralRe: XP Buttons on non grey backgrounds Pin
James R. Twine10-May-05 1:53
James R. Twine10-May-05 1:53 
GeneralRe: XP Buttons on non grey backgrounds Pin
Jörgen Sigvardsson10-May-05 2:01
Jörgen Sigvardsson10-May-05 2:01 
GeneralRe: XP Buttons on non grey backgrounds Pin
RChin10-May-05 1:56
RChin10-May-05 1:56 
GeneralRe: XP Buttons on non grey backgrounds Pin
Jörgen Sigvardsson10-May-05 1:58
Jörgen Sigvardsson10-May-05 1:58 
GeneralRe: XP Buttons on non grey backgrounds Pin
khan++10-May-05 2:27
khan++10-May-05 2:27 
GeneralRe: XP Buttons on non grey backgrounds Pin
Jörgen Sigvardsson10-May-05 2:49
Jörgen Sigvardsson10-May-05 2:49 
GeneralRe: XP Buttons on non grey backgrounds Pin
Jörgen Sigvardsson10-May-05 3:06
Jörgen Sigvardsson10-May-05 3:06 
Generalrecv problem Pin
srev10-May-05 1:26
srev10-May-05 1:26 
GeneralVirtual function problem! Pin
Bob Stanneveld10-May-05 0:11
Bob Stanneveld10-May-05 0:11 
GeneralRe: Virtual function problem! Pin
Cedric Moonen10-May-05 0:28
Cedric Moonen10-May-05 0:28 
GeneralRe: Virtual function problem! Pin
Bob Stanneveld10-May-05 1:09
Bob Stanneveld10-May-05 1:09 
GeneralRe: Virtual function problem! Pin
Cedric Moonen10-May-05 1:34
Cedric Moonen10-May-05 1:34 
GeneralRe: Virtual function problem! Pin
S. Senthil Kumar10-May-05 1:43
S. Senthil Kumar10-May-05 1:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.