Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Afterburn - 05 Oct 2004 17:20 GMT
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.
William DePalo [MVP VC++] - 05 Oct 2004 21:13 GMT
> 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
Afterburn - 06 Oct 2004 09:52 GMT
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.

>> Has anyone ever experienced this error occuring when trying to call
>> AddPrinterConnection() from VC6. This is a microsoft defined method
[quoted text clipped - 13 lines]
>Regards,
>Will
William DePalo [MVP VC++] - 06 Oct 2004 15:40 GMT
> 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
Afterburn - 06 Oct 2004 16:03 GMT
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.

>> This is the line of code I had implemented.
>>
[quoted text clipped - 28 lines]
>Regards,
>Will

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.