473,657 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Hi,

Has anyone ever experienced this error occuring when trying to call
AddPrinterConne ction() 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 5179
"Afterburn" <Af*******@nosp am.com> wrote in message
news:uf******** *************** *********@4ax.c om...
Has anyone ever experienced this error occuring when trying to call
AddPrinterConne ction() 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 AddPrinterConne ction(). 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_PENDI NG). This is the line of code I had
implemented.

if(!AddPrinterC onnection(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*******@nosp am.com> wrote in message
news:uf******* *************** **********@4ax. com...
Has anyone ever experienced this error occuring when trying to call
AddPrinterConne ction() 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 AddPrinterConne ction(). 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*******@nosp am.com> wrote in message
news:r7******** *************** *********@4ax.c om...
This is the line of code I had implemented.

if(!AddPrinterC onnection(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*******@nosp am.com> wrote in message
news:r7******* *************** **********@4ax. com...
This is the line of code I had implemented.

if(!AddPrinterC onnection(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
5439
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 KB824146. I also started getting DCOM errors in the Server System log just after the reboot. When anyone goes to open an ASP based page they get : HTTP 500 - Internal server error We are just using ASP and not .NET. All other webserver...
1
1532
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: DCOM Event Category: None Event ID: 10004 Date: 16/06/2004 Time: 14:36:48
3
6399
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 in progress" and was unable to logon .\IWAM_servername in order to run the server. Followed by another error: The server stop serving requests for application __________ because of the number of out of process component crashes exceeded a...
8
9574
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> Uninstalled old version, installed new version, and am now trying to use the CLP. <<<<<<<<<<<< For more detailed help, refer to the Online Reference Manual.
7
9703
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 for this being to stop the user thinking the application has frozen when in fact it is just waiting for a long SP to complete. Another reason for doing it like this is that I also have had a problem in the past where the SP takes longer than the...
0
1742
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. I have an unboud form that records all the objectives. User can put more than one progress assessment code and comment for each objective. I have a control on Objective form that opens up Progress assessment form. The code behind this control...
0
1487
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 detail of the error message: Event Type: Error Event Source: MSSQL$SQLEXPRESS Event Category: (2) Event ID: 3633
1
9631
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 running windows xp. Further, I have setup a full domain controller environment. I have managed to write the code to add the network printer and it works fine when installing the printer on the same machine the code is executing from i.e the server or...
7
4599
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 targeting x64 or AnyCPU. The problem appears to be that ReadFile() sets lpNumberOfBytesRead to 0, even though the receive buffer contains the data I'm expecting. Is this a known issue, or am I just doing something dumb? I can provide a small test app via...
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7316
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.