【问题标题】:How to configure the note types in XFS with the 'WFS_CMD_CIM_CONFIGURE_NOTETYPES' command如何使用“WFS_CMD_CIM_CONFIGURE_NOTETYPES”命令在 XFS 中配置注释类型
【发布时间】:2017-07-04 09:09:47
【问题描述】:

我想在现金操作期间配置特定的票据类型

输入参数格式如下:LPUSHORT lpusNoteIDs;

当我执行以下命令时出现无效数据错误 (-52)

LPUSHORT* lpusNoteIDs;  
lpusNoteIDs = (LPUSHORT*)malloc(7*sizeof(LPUSHORT));
for(int i =0;i<7;i++)
{
    lpusNoteIDs[i]=(LPUSHORT)malloc(sizeof(USHORT));
}

lpusNoteIDs[0] = (LPUSHORT)0x2700;
lpusNoteIDs[1] = (LPUSHORT)0x2710;
lpusNoteIDs[2] = (LPUSHORT)0x2701;
lpusNoteIDs[3] = (LPUSHORT)0x2711;
lpusNoteIDs[4] = (LPUSHORT)0x2721;
lpusNoteIDs[5] = (LPUSHORT)0x2732;
lpusNoteIDs[6] = (LPUSHORT)0x2704;
hResult = WFSExecute(hService, WFS_CMD_CIM_CONFIGURE_NOTETYPES, (LPVOID)lpusNoteIDs, 400000, &res);
return (int)hResult;

我什至尝试过下面的代码,但它给了我同样的错误

LPUSHORT* lpusNoteIDs;
USHORT abc[]={1000,9985,10001,10017,10034,9988};
lpusNoteIDs=(LPUSHORT*)abc;
hResult = WFSExecute(hService, WFS_CMD_CIM_CONFIGURE_NOTETYPES,(LPVOID)lpusNoteIDs, 600000, &res);
return (int)hResult;

在 CIM 服务提供商实施规范 文档中说:

lpusNoteIDs :-指向一个以 NULL 结尾的未签名短裤列表,其中包含钞票的纸币 ID

关于如何传递值的任何帮助都将非常有用.. 提前致谢。

【问题讨论】:

    标签: c++ pointers structure xfs cen-xfs


    【解决方案1】:

    您必须使用 WFMAllocate 和 WFMAllocateMore 函数为 XFS 结构分配内存,以便在应用程序和服务提供者之间传输它。 您的示例如下:

    LPUSHORT lpusNoteIDs = NULL;
    const int countNotes = 7;
    // Always use WFMAllocate* functions for XFS memory allocation
    WFSRESULT hr = WFMAllocateBuffer(sizeof(USHORT)*(countNotes+1), WFS_MEM_ZEROINIT|WFS_MEM_SHARE, (void**)&lpusNoteIDs);
    
    // Fill note ID's
    lpusNoteIDs[0] = (USHORT)0x2700;
    lpusNoteIDs[1] = (USHORT)0x2710;
    lpusNoteIDs[2] = (USHORT)0x2701;
    lpusNoteIDs[3] = (USHORT)0x2711;
    lpusNoteIDs[4] = (USHORT)0x2721;
    lpusNoteIDs[5] = (USHORT)0x2732;
    lpusNoteIDs[6] = (USHORT)0x2704;
    
    hr = WFSExecute(hService, WFS_CMD_CIM_CONFIGURE_NOTETYPES, (LPVOID)&lpusNoteIDs, 400000, &res);
    

    【讨论】:

    • 当我检查银行票据类型时,它显示这些类型的票据已配置..但它们没有得到配置@Alex.D.Alexeev
    • @AlexDAlexeev 它存储垃圾值
    • 我觉得代码有点小错误:hr = WFSExecute(hService, WFS_CMD_CIM_CONFIGURE_NOTETYPES, (LPVOID)lpusNoteIDs, 400000, &res);删除 lpusNoteIDs 之前的 &
    猜你喜欢
    • 1970-01-01
    • 2015-12-13
    • 1970-01-01
    • 2018-08-01
    • 2019-12-06
    • 1970-01-01
    • 2020-04-25
    • 1970-01-01
    • 2020-01-26
    相关资源
    最近更新 更多