Article View: borland.public.cppbuilder.nativeapi
Article #14822Overlapped I/O operation is in progress - Service functions
From: Maurice Anderson
Date: Thu, 31 Jul 2003 07:22
Date: Thu, 31 Jul 2003 07:22
40 lines
2007 bytes
2007 bytes
I have this code:
SC_HANDLE hService = ::OpenService(hSCM, szSvcName,
SERVICE_PAUSE_CONTINUE);
PrintError(GetLastError());
WaitForSingleObjectEx(oOverlap.hEvent, 1000, TRUE);
if (hService == NULL)
{
return ret_code;
}
//--------------------------------------------------------------------------
-
void __fastcall TServiceCommands::PrintError(unsigned long code)
{
char *serr;
if(::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&serr,
0,
NULL) == 0)
{
Application->MessageBox("Unknown Error\n", "Service", MB_OK);
}
PrintError formats the error message from GetLastError(). The problem is I
get this error message:
"Overlapped I/O operation is in progress"
after PrintError(GetLastError) executes. The code predeces normally but I
would like to stop this error from occurring. What is this error? How can
I get rid of it?
Thanks..
Technical Details
Message-ID:
<3f28c2fd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,61a755f387ee0607,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-31 00:28:04 PST From: "Maurice Anderson" <mauriceanderson@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Overlapped I/O operation is in progress - Service functions Date: Thu, 31 Jul 2003 00:22:18 -0700 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 64.30.203.223 Message-ID: <3f28c2fd$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059635965 64.30.203.223 (31 Jul 2003 00:19:25 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail