473,385 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

AddPrinterConnection() returns error 997 (Overlapped I/O operation is in progress)

Hi,

Has anyone ever experienced this error occuring when trying to call
AddPrinterConnection() from VC6. This is a microsoft defined method
call. I have been able to reproduce it on a windows200 professional
machine will latest service packs downloading the printer drivers from
a windows2003 server.

It seems to work on other configurations as I have been unable to
reproduce the problem occuring there.

According to the documentation for Overlapped I/O it basically means
that the operation has not completed yet but will complete later. If
this is the case how do you check that the request has completed and
shouldn't microsoft handle this and finish it's call once the driver
has completly downloaded.

Cheers.
Nov 17 '05 #1
4 5160
"Afterburn" <Af*******@nospam.com> wrote in message
news:uf********************************@4ax.com...
Has anyone ever experienced this error occuring when trying to call
AddPrinterConnection() from VC6. This is a microsoft defined method
call. I have been able to reproduce it on a windows200 professional
machine will latest service packs downloading the printer drivers from
a windows2003 server.


At the risk of asking the obvious: Does the function return a true (i.e.
non-zero value) or FALSE (0)?

In case you don't know, calling GetLastError() is meaningful _only_ in the
case where a function fails - in this case where it returns zero - and then
only _immediately_ after the call to AddPrinterConnection(). The reason for
that is that the last error is a kind of thread-specific global variable
which is often, but not always, cleared on success.

Regards,
Will
Nov 17 '05 #2
Hi Will,

On the return type I checked this in the code for True or False and it
comes back false. When it comes back false I then check the error code
and it reports 997 (ERROR_IO_PENDING). This is the line of code I had
implemented.

if(!AddPrinterConnection(xxx)) {
DWORD lastError = GetLastError();
...
...
}

Do you think if I continue on and ignore this error it may work. Any
idea if there is a way to check if pending IO is currently in progress
and when it finishes.

Cheers,
A.
On Tue, 5 Oct 2004 16:13:22 -0400, "William DePalo [MVP VC++]"
<wi***********@mvps.org> wrote:
"Afterburn" <Af*******@nospam.com> wrote in message
news:uf********************************@4ax.com.. .
Has anyone ever experienced this error occuring when trying to call
AddPrinterConnection() from VC6. This is a microsoft defined method
call. I have been able to reproduce it on a windows200 professional
machine will latest service packs downloading the printer drivers from
a windows2003 server.


At the risk of asking the obvious: Does the function return a true (i.e.
non-zero value) or FALSE (0)?

In case you don't know, calling GetLastError() is meaningful _only_ in the
case where a function fails - in this case where it returns zero - and then
only _immediately_ after the call to AddPrinterConnection(). The reason for
that is that the last error is a kind of thread-specific global variable
which is often, but not always, cleared on success.

Regards,
Will


Nov 17 '05 #3
"Afterburn" <Af*******@nospam.com> wrote in message
news:r7********************************@4ax.com...
This is the line of code I had implemented.

if(!AddPrinterConnection(xxx)) {
DWORD lastError = GetLastError();
...
...
Assuming that the code is as wriiten above then that is the correct way to
do it.
Do you think if I continue on and ignore this error it may work.
I doubt it.
Any idea if there is a way to check if pending IO is currently
in progress and when it finishes.


Well, the initiator of the I/O can, but you can't because you don't have the
device handle or the "overlapped" structure or any other useful information
about the operation in progress.

I wish I had something good to tell you but I don't. In fact, there may not
even be I/O in progress. It is possible that the implementation has already
waited on the operation to complete but no subsequent operation has reset
the thread's last error code.

It might be a bug in a driver or something (wild a__ speculation on my
part). You might want to post again in a GDI group and hope for a more
definitive reply.

Regards,
Will
Nov 17 '05 #4
Hi Will,

Thanks for the info below. I think alright it's a bit of hit and miss
to try and pinpoint it down to why it could be happing. I did try
ignore the error and continue on anyway and as you say below this
didn't work, long shot I know :)

I'll post the message in one of the GDI groups and will post any
updates to this message if I get any additional info.

Thanks again,
A.B.
On Wed, 6 Oct 2004 10:40:13 -0400, "William DePalo [MVP VC++]"
<wi***********@mvps.org> wrote:
"Afterburn" <Af*******@nospam.com> wrote in message
news:r7********************************@4ax.com.. .
This is the line of code I had implemented.

if(!AddPrinterConnection(xxx)) {
DWORD lastError = GetLastError();
...
...


Assuming that the code is as wriiten above then that is the correct way to
do it.
Do you think if I continue on and ignore this error it may work.


I doubt it.
Any idea if there is a way to check if pending IO is currently
in progress and when it finishes.


Well, the initiator of the I/O can, but you can't because you don't have the
device handle or the "overlapped" structure or any other useful information
about the operation in progress.

I wish I had something good to tell you but I don't. In fact, there may not
even be I/O in progress. It is possible that the implementation has already
waited on the operation to complete but no subsequent operation has reset
the thread's last error code.

It might be a bug in a driver or something (wild a__ speculation on my
part). You might want to post again in a GDI group and hope for a more
definitive reply.

Regards,
Will


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ralph | last post by:
HTTP 500 - Internal server error ASP pages I am running Windows 2K with IIS 5.1 and I started having problems accessing ASP databases shortly after applying the MS patch Windows 2000 Hotfix...
1
by: Shahzad | last post by:
Hello I m getting the Following on my machine in Event Viewer... can any body Help me ... but please guide me to the right way...........:) --------------------- Event Type: Error Event Source:...
3
by: AmyAdmin | last post by:
I am running windows 2000 with IIS 5.0 and I have ASP and .NET apps running on that server, and I've been getting the error message in my event viewer: DCom got error "Overlapped I/O operation is...
8
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> ...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
0
by: Kaur | last post by:
Hi, I need help on a code that each time I add a new record it gives me an error "Eithe EOF or BOF is true, or the current record has been deleted. Requested operation requires a current record....
0
by: Seok Bee | last post by:
Hi, My server is currently installed with SQL Server 2005. I checked in the Event Viewer log file I noticed that I get the error message which the source is MSSQL$SQLEXPRESS, following is the...
1
by: ekynox | last post by:
Hi guys, have been playing with WMI to add a network printer connection to a Windows XP pc. My environment consists of a server running Windows Server 2003 and Visual Studio 2005 and a test pc...
7
by: =?Utf-8?B?TmljayBCdXJraXR0?= | last post by:
Hi. I have a C# app that uses named pipes via InteropServices. I have no problems running on a 32-bit machine, or when targeting x86 architecture, but it fails on a 64-bit machine when...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.