Autor Beitrag
Cortex
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Mi 02.12.15 14:07 
Guten Tag,

ich möchte mit einem Scanner (Plustek PS406U) etwas einscannen. Leider erhalten ich immer folgende Fehlermeldung:
System.Runtime.Interop.Services.COMException (0x8000FFFF): Schwerwiegender Fehler

Ich benutze den WIA Treiber um den ADF Scanner anzusteuern. Er scannt auch wie ich es möchte nur nicht Duplex. Der Fehler könnte in folgenden Codeschnipseln liegen:

ausblenden volle Höhe C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
if (deviceProperty.PropertyID == 3088)// == "Document Handling Select") //or PropertyID == 3088
{
    try
    {
        //wia.Properties["Document Handling Select"].set_Value(5);
        //  int value = duplex ? 0x004 : 0x001;
        object value = 5;
        deviceProperty.set_Value(ref value);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}


do
{
    //Connect to Device
    Device wia = Connect();
    WIA.Item item = wia.Items[1as WIA.Item;
    AdjustScannerSettings(item, DialogExchange.Config_ScanColorMode);

    //Setup ADF
    if ((useAdf) || (duplex))
        SetupADF(wia, duplex);

    //Setup Page Size
    SetupPageSize(wia, rotatePage, pageSize, DPI, item);


    WIA.ImageFile imgFile = null;
    WIA.ImageFile imgFile_duplex = null//if duplex is setup, this will be back page


    imgFile = (ImageFile)WiaCommonDialog.ShowTransfer(item, WIA.FormatID.wiaFormatJPEG);

    //If duplex page, get back page now.
    if (duplex)
    {
        imgFile_duplex = (ImageFile)WiaCommonDialog.ShowTransfer(item, WIA.FormatID.wiaFormatJPEG);
    }

    string varImageFileName = filepath + "\\Scanned-" + pages.ToString() + ".jpg";
    Delete_File(varImageFileName); //if file already exists. delete it.
    imgFile.SaveFile(varImageFileName);

    string varImageFileName_duplex;

    if (duplex)
    {
        varImageFileName_duplex = filepath + "\\Scanned-" + pages++.ToString() + ".jpg";
        Delete_File(varImageFileName_duplex); //if file already exists. delete it.
        imgFile_duplex.SaveFile(varImageFileName);
    }

    //Check with scanner to see if there are more pages.
    if (useAdf || duplex)
    {
        hasMorePages = HasMorePages(wia);
        pages++;
    }

}
while (hasMorePages);


Moderiert von user profile iconTh69: C#-Tags hinzugefügt