$PBExportHeader$kms_getkms_msg.srf
global type kms_getkms_msg from function_object
end type

forward prototypes
global function s_kms_msg kms_getkms_msg (string msgid, string arg0, string arg1, string arg2, string arg3, string arg4)
end prototypes

global function s_kms_msg kms_getkms_msg (string msgid, string arg0, string arg1, string arg2, string arg3, string arg4);uo_comhelper lo_helper
lo_helper = Create uo_comhelper

oleobject lo_p1client,lo_request,lo_rsp, lo_rslt
string arg_msg_tmp

lo_p1client = lo_helper.uf_get_p1clientcom(Ref arg_msg_tmp)
Destroy lo_helper

s_kms_msg s_rslt

IF NOT ISVALID(lo_p1client) THEN
	s_rslt.Msg = '未知异常>获取业务后台连接失败: ' + arg_msg_tmp
	MessageBox('Error', s_rslt.Msg)
	RETURN s_rslt
END IF


lo_request = lo_p1client.NewPBDictionary()

lo_request.SetString("msgid", msgid)
lo_request.SetString("arg0", arg0)
lo_request.SetString("arg1", arg1)
lo_request.SetString("arg2", arg2)
lo_request.SetString("arg3", arg3)
lo_request.SetString("arg4", arg4)

//MessageBox('', arg_text + "~r~ntextsize:"+string(arg_textsize)+",width:"+string(arg_width)+",height:"+string(arg_height))

lo_rsp = lo_p1client.invokeclient("GetKMS_MSG", lo_request)

arg_msg_tmp = lo_rsp.GetString("ErrMsg")
if arg_msg_tmp <> '' then
	IF runtimeLog THEN sys_trace(arg_msg_tmp)
	s_rslt.Msg = arg_msg_tmp
	return s_rslt
end if

lo_rslt = lo_rsp.getpbdictionary("rtn")

s_rslt.msgid = msgid
s_rslt.Msg = lo_rslt.GetString("Msg")
s_rslt.DocCode1 = lo_rslt.GetString("DocCode1")
s_rslt.DocCode2 = lo_rslt.GetString("DocCode2")
s_rslt.Msgtype = lo_rslt.GetInt("Msgtype")

//MessageBox('', arg_text + "~r~ntextsize:"+string(arg_textsize)+",width:"+string(arg_width)+",height:"+string(arg_height))

return s_rslt
end function

