typedef void (*onPaymentResultCallback) (int result);
DLL_EXPORT int AR_payment_item_credit(const char *terminal_no, const char *description, double amount, enum currency_id cid, int receiptid,
onPaymentResultCallback cb);
를 델파이 :변환하는 방법 C/C++ 콜백 functon이 같은 definetions 위의 변환
TonPaymentResultCallback = procedure(result:LongInt) of object;
function AR_payment_item_credit(HInst:THandle; const TerminalNo:PAnsiChar; const Description:PAnsiChar; Amount:Double; CurrencyId:LongInt;
RecepitID:LongInt; onPaymentResultCallback:tonPaymentResultCallback):LongInt;
var
MyFunct: function (const TerminalNo:PAnsiChar; const Description:PAnsiChar; Amount:Double; CurrencyId:LongInt;
RecepitID:LongInt; onPaymentResultCallback:tonPaymentResultCallback): LongInt; cdecl;
begin
Result := 0;
MyFunct:=GetProcAddress(HInst,'AR_payment_item_credit');
if Assigned(MyFunct) then
Result := MyFunct(TerminalNo, Description, Amount, CurrencyId, RecepitID,onPaymentResultCallback);
end;
델파이로 변환하는 C/C++ DLL 함수를 알고 있지만 콜백 나를 위해 새로운 기능입니다. 내 정의가 맞습니까?
C 또는 C++의 언어는 무엇입니까? 그들은 다른 언어입니다. 예를 들어 C++에는 연산자 및 함수 오버로드가있어 이름 변환이 발생할 수 있습니다. –
C 함수는 cdecl처럼 보입니다 –