簡體   English   中英

如何使用“ WFS_CMD_CIM_CONFIGURE_NOTETYPES”命令在XFS中配置便箋類型

[英]How to configure the note types in XFS with the 'WFS_CMD_CIM_CONFIGURE_NOTETYPES' command

我想在現金操作期間配置特定的便箋類型

輸入參數應采用以下格式: 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

關於必須如何傳遞值的任何幫助將非常有用。

您必須使用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);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM