Kofax System.Runtime.InteropServices.COMException:&x27;[24]KdoLib:未知错误;

Kofax System.Runtime.InteropServices.COMException:&x27;[24]KdoLib:未知错误;,kofax,Kofax,我为自定义模块创建了一个设置表单。启动管理模块时,我可以使用batchClass.get_CustomStorageString(“key”)为自定义模块运行时设置一些设置(通过键获取值)和batchClass.set_CustomStorageString(“键”、“值”)(按键设置值)。在管理模块中,我可以在多次启动时访问存储数据,因此一切正常 在运行时运行batchmanager时,自定义模块尝试使用相同的密钥访问数据,并抛出此错误 System.Runtime.InteropServic

我为自定义模块创建了一个设置表单。启动管理模块时,我可以使用
batchClass.get_CustomStorageString(“key”)为自定义模块运行时设置一些设置
(通过键获取值)和
batchClass.set_CustomStorageString(“键”、“值”)(按键设置值)。在管理模块中,我可以在多次启动时访问存储数据,因此一切正常

在运行时运行batchmanager时,自定义模块尝试使用相同的密钥访问数据,并抛出此错误

System.Runtime.InteropServices.COMException:“[24]KdoLib:未知 错误。”


错误消息本身不提供出错的信息。设置窗体处理一批类型
IBatchClass
,运行时处理类型
IBatch
。因此运行时使用批处理.get_CustomStorageString(“key”)。这种访问数据的方式不正确吗?

似乎是我自己解决的。在运行期间,我必须提取设置数据。这将返回批处理类,这些将返回当前批处理类。批处理类本身保存要访问的自定义存储字符串

代码应该是

    private const string BATCH_CLASSES = "BatchClasses";
    private const string BATCH_CLASS = "BatchClass";
    private const string BATCH_CLASS_CUSTOM_STORAGE_STRINGS = "BatchClassCustomStorageStrings";
    private const string BATCH_CLASS_CUSTOM_STORAGE_STRING = "BatchClassCustomStorageString";

    public void ProcessBatch(IBatch batch)
    {
        IACDataElement setupElement = batch.ExtractSetupACDataElement(0);
        IACDataElementCollection batchClasses = setupElement.FindChildElementByName(BATCH_CLASSES).FindChildElementsByName(BATCH_CLASS);
        IACDataElement batchClass = batchClasses[1]; // Kofax starts at 1 // always take the first item because there is only one?
        IACDataElement customStorageStrings = batchClass.FindChildElementByName(BATCH_CLASS_CUSTOM_STORAGE_STRINGS);

        IACDataElement customStorageItem = customStorageStrings.FindChildElementByAttribute(BATCH_CLASS_CUSTOM_STORAGE_STRING, "Name", "-- myKey --");
        string customStorageItemValue = customStorageItem["Value"];
    }
我在上找到了示例代码

…\CaptureSV\Source\Sample Projects\Workflow\WFSample


登录完成并打开批处理后,是否尝试访问字符串?批次是否使用相同的定义(批次类)?我在登录后访问该字符串。批使用相同的定义,尽管批类型为
IBatch
,在设置时,我将字符串存储到
IBatchClass
object@WolfgangRadl我可能发现了问题:因此在运行时我使用
IBatch
接口,但我必须使用
ibatchlass
接口。如何从批处理中获取批处理类?我只能使用
batch访问批处理类名。BatchClassName
QAID#4137讨论了AscentCaptureModule库的用法。我猜您正在使用DBLite和DBLiteOpt库。我对您的答案投了赞成票,因为这是解决Kofax API中错误的正确方法。文档(API参考)清楚地说明了您最初的做法应该是可行的。错误消息(未知错误)也让我认为这只能是一个bug。