效果:
源码:
extern DllExport void ufsta(char *param, int *returnCode, int rlen) { UF_initialize(); string strMenu1 = "问题1:"; string strMenu2 = "问题2:"; char menu[2][16] = { "" }; strcpy(menu[0], strMenu1.c_str()); strcpy(menu[1], strMenu2.c_str()); int iNum = 2;//问题数量 string strVal1 = "答案1"; string strVal2 = "答案2"; char val[2][31] = { "" }; strcpy(val[0], strVal1.c_str()); strcpy(val[1], strVal2.c_str()); int intVal[2] = { 0,0 }; double douVal[2] = { 0,0 }; int arr[2] = { 301,301 }; int iRe = uc1613("提示信息", menu, iNum, intVal, douVal, val, arr); string strReturn1 = ""; string strReturn2 = ""; if (iRe == 3 || iRe == 4) { strReturn1 = val[0]; strReturn2 = val[1]; } /* iRe 1 = Back 2 = Cancel Operation 3 = OK - No user input 4 = OK with user input 8 = Disallowed state, unable to bring up dialog */ UF_terminate(); } extern int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }