델파이 5로 POS 프로그램을 개발 하고 있습니다...
POS 프로그램에 카드결제 부분은 처음 해봐서..
예제를 보고 하고 있습니다.
신용 결제에서 정상처리는 되는데 승인값 받고
마지막에 메모리 제거 하는 부분에서 오류가 발생 합니다.
경험이 있는 고수님... 부탁합니다.
첨부파일은 오류 부분입니다.
<!--CodeS-->
//신용 승인
// DLL 함수
function FDIK_CreditAuth_Simple(in_terminal_number : pChar; in_sequence_number : pChar; in_pos_initial : pChar;
in_temp_info : pChar; in_credit_info : pChar; in_credit_input_type : pChar;
in_install_period : pChar; in_total_amount : pChar; in_service_amount : pChar;
in_tax_amount : pChar; in_ocb_info : pChar; in_ocb_input_type : pChar;
in_sign_compress_method : pChar; in_sign_mac : pChar; in_sign_data : pChar;
out_print_flag : pChar; out_res_code : pChar; out_auth_number : pChar;
out_auth_date : pChar; out_member_number : pChar; out_ddc_flag : pChar;
out_ddc_number : pChar; out_res_msg : pChar; out_card_name : pChar;
out_issuer_code : pChar; out_issuer_name : pChar; out_acquirer_code : pChar;
out_acquirer_name : pChar; out_gift_cash : pChar; out_notice : pChar;
out_ocb_res_code : pChar; out_customer_name : pChar; out_add_point : pChar;
out_save_point : pChar; out_usable_point : pChar; out_broad_msg : pChar) : integer; stdcall; external 'fdikpos43.dll' name 'FDIK_CreditAuth_Simple';
//출력변수 할당
GetMem(out_print_flag, 10);
GetMem(out_res_code, 10);
GetMem(out_auth_number, 20);
GetMem(out_auth_date, 10);
GetMem(out_member_number, 20);
GetMem(out_ddc_flag, 10);
GetMem(out_ddc_number, 10);
GetMem(out_res_msg, 40);
GetMem(out_card_name, 40);
GetMem(out_issuer_code, 10);
GetMem(out_issuer_name, 10);
GetMem(out_acquirer_code, 10);
GetMem(out_acquirer_name, 10);
GetMem(out_gift_cash, 10);
GetMem(out_notice, 30);
GetMem(out_ocb_res_code, 10);
GetMem(out_customer_name, 20);
GetMem(out_add_point, 10);
GetMem(out_save_point, 10);
GetMem(out_usable_point, 10);
GetMem(out_broad_msg, 120);
try
ZeroMemory(in_sign_data, 1600); //사인데이터 초기화
//출력변수 초기화
ZeroMemory(out_print_flag, 10);
ZeroMemory(out_res_Code, 10);
ZeroMemory(out_auth_number, 20);
ZeroMemory(out_auth_date, 10);
ZeroMemory(out_member_number, 20);
ZeroMemory(out_ddc_flag, 10);
ZeroMemory(out_ddc_number, 10);
ZeroMemory(out_res_msg, 40);
ZeroMemory(out_card_name, 40);
ZeroMemory(out_issuer_code, 10);
ZeroMemory(out_issuer_name, 10);
ZeroMemory(out_acquirer_code, 10);
ZeroMemory(out_acquirer_name, 10);
ZeroMemory(out_gift_Cash, 10);
ZeroMemory(out_notice, 30);
ZeroMemory(out_ocb_res_code, 10);
ZeroMemory(out_customer_name, 20);
ZeroMemory(out_add_point, 10);
ZeroMemory(out_save_point, 10);
ZeroMemory(out_usable_point, 10);
ZeroMemory(out_broad_msg, 120);
//신용 승인 함수 실행
iRet := FDIK_CreditAuth_Simple(PChar(in_terminal_number), PChar (in_sequence_number), PChar(in_pos_initial),
PChar(in_temp_info), PChar(in_credit_info), PChar(in_credit_input_type),
PChar(in_install_period), PChar(in_total_amount), PChar(in_service_amount),
PChar(in_tax_amount), PChar(in_ocb_info), PChar(in_ocb_input_type),
PChar(in_sign_compress_method), PChar(in_sign_mac), in_sign_data,
out_print_flag, out_res_code, out_auth_number, out_auth_date,
out_member_number, out_ddc_flag, out_ddc_number, out_res_msg,
out_card_name, out_issuer_code, out_issuer_name, out_acquirer_code,
out_acquirer_name, out_gift_cash, out_notice, out_ocb_res_code,
out_customer_name, out_add_point, out_save_point, out_usable_point,
out_broad_msg);
// ===============
// 결과값 DB에 저장
// ===============
finally
FreeMem(in_sign_data, 1600);
FreeMem(out_print_flag, 10);
FreeMem(out_res_Code, 10);
FreeMem(out_auth_number, 20);
FreeMem(out_auth_date, 10); <- 오류 부분
FreeMem(out_member_number, 20);
FreeMem(out_ddc_flag, 10);
FreeMem(out_ddc_number, 10);
FreeMem(out_res_msg, 40);
FreeMem(out_card_name, 40);
FreeMem(out_issuer_code, 10);
FreeMem(out_issuer_name, 10);
FreeMem(out_acquirer_code, 10);
FreeMem(out_acquirer_name, 10);
FreeMem(out_gift_Cash, 10);
FreeMem(out_notice, 30);
FreeMem(out_ocb_res_code, 10);
FreeMem(out_customer_name, 20);
FreeMem(out_add_point, 10);
FreeMem(out_save_point, 10);
FreeMem(out_usable_point, 10);
FreeMem(out_broad_msg, 120);
end;
<!--CodeE-->