Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: The "WIA Sample Scanner Device" dialog box does not open when you click "Scan" in the "WIASCANR Panel" dialog box in the Windows Server 2003 Service Pack 1 Driver Development Kit (DDK)


View products that this article applies to.

Symptoms

In the Microsoft Windows Server 2003 Service Pack 1 Driver Development Kit (DDK), the WIA Sample Scanner Device dialog box does not open as expected when you click Scan in the WIASCANR Panel dialog box.

↑ Back to the top


Cause

This problem occurs because of a bug in the source code of the WIASCANR sample. When the WIA Scanner Sample Front Panel Simulator tool (scanpanl.exe) triggers an event, the Microsoft Windows Image Acquisition (WIA) service asks for the list of WIA events that the WIASCANR sample supports through the IWiaMiniDrv::drvGetCapabilities method. If the IWiaMiniDrv::drvInitializeWia method is not executed first, the list of WIA capabilities that contains the WIA events that the WIASCANR sample supports is not initialized. The WIASCANR sample cannot successfully detect that the capabilities have not been initialized before the WIASCANR sample returns to the call. Therefore, the WIA service obtains an empty list of WIA events. This causes the WIA Sample Scanner Device dialog box not to open when you click Scan.

↑ Back to the top


Resolution

To resolve this problem, modify the code of the IWiaMiniDrv.cpp file. To do this, follow these steps:
  1. Open the IWiaMiniDrv.cpp file that is contained in the Windows DDK.
  2. Locate the following line of code.
    if (NULL != m_pCapabilities) {
    Note You can find this line of code at line 2358 if you use Microsoft Visual Studio .NET to open the IWiaMiniDrv.cpp file.
  3. Change this line of code to the following line of code, and then save the changes to the IWiaMiniDrv.cpp file.
    if (!m_pCapabilities) {
  4. Open a Windows free build environment.
  5. Type the following command at the command prompt in the build environment:
    cd src
    cd wdm
    cd wia
    build �cZ
    copywia
    
  6. In Control Panel, open Scanners and Cameras, and then double-click Add Device.
  7. In the Scanner and Camera Installation Wizard, click Next.
  8. Click Have Disk, and then click Browse.
  9. Locate and then click the Wiascanr.inf file, click Open, and then click OK.
  10. In the Model box, click WIA Sample Scanner Device, click Next three times, and then click Finish.

    Note You do not have to restart the computer unless you are installing over another instance of the WIASCANR sample.
  11. Start the WIA Scanner Sample Front Panel Simulator tool. In the WIASCANR Panel dialog box, click Scan.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More information

To open the WIASCANR Panel dialog box, follow these steps:
  1. Click Start.
  2. Click Development Kits.
  3. Click Windows DDK 3790.1830.
  4. Click Tools.
  5. Click WIA Scanner Sample Front Panel Simulator.

↑ Back to the top


Keywords: KB896701, kbbug, kbtshoot

↑ Back to the top

Article Info
Article ID : 896701
Revision : 2
Created on : 7/25/2005
Published on : 7/25/2005
Exists online : False
Views : 423