Article View: borland.public.cppbuilder.nativeapi
Article #4342Re: [C++ Error] E2034 Cannot convert 'int' to 'void *'
From: Remy Lebeau (TeamB)
Date: Sat, 18 Feb 2006 03:45
Date: Sat, 18 Feb 2006 03:45
45 lines
2140 bytes
2140 bytes
"Darko Miletic" <darko@uvcms.com> wrote in message
news:43f62100$1@newsgroups.borland.com...
> More appropriate code would be like this:
Alternatively:
PEVENTLOGRECORD rec = NULL;
DWORD nBytesRead = 0;
DWORD nBytesRequired = 0;
if( !ReadEventLog(
logHandle,
EVENTLOG_BACKWARDS_READ | EVENTLOG_SEQUENTIAL_READ,
0,
NULL,
0,
&nBytesRead,
&nBytesRequired) )
{
if( GetLastError() == ERROR_INSUFFICIENT_BUFFER )
{
rec = (PEVENTLOGRECORD) LocalAlloc(LMEM_FIXED, nBytesRequired);
if( rec )
{
if( ReadEventLog(
logHandle,
EVENTLOG_BACKWARDS_READ | EVENTLOG_SEQUENTIAL_READ,
0,
rec,
nBytesRequired,
&nBytesRead,
&nBytesRequired) )
{
// use rec as needed ....
}
LocalFree(rec);
}
}
}
Gambit
Technical Details
Message-ID:
<43f69746$3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43f616d2$1@newsgroups.borland.com> <43f62100$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8ec6b60facd951bc X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <43f616d2$1@newsgroups.borland.com> <43f62100$1@newsgroups.borland.com> Subject: Re: [C++ Error] E2034 Cannot convert 'int' to 'void *' Date: Fri, 17 Feb 2006 19:45:06 -0800 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 68.69.17.41 Message-ID: <43f69746$3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1140234054 68.69.17.41 (17 Feb 2006 19:40:54 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail