L
Leandro H. Delamare
Hello group.
I'm with a problem a few days with Smart Cards
I Have an C++ DLL with some funcions to read a Smart Card.
But the problem is, I have the declarations in C++ and a Program Example in
Delphi.
I want to make this program with C#
How I Can Import and use the DLL Funcions in My C# Program. Some functions
is working OK, but I have a function called EAG_GetCardCredits doesn't work.
The C++ Declaration is : int WINAPI EAG_GetCardCredits(int iHandle, int
iPurseId, long *lpCardCredits);
In My C# Program I Declarate this way:
[DllImport("Crypto.dll")]
public static unsafe extern int EAG_GetCardCredits(int iHandle, int
iPurseId, out long* lpCardCredits);
The Sample in Delphi is :
Function GetCardCredits(): String;
var st: Integer;
CardCredits: LongInt;
aux,aux2: string;
begin
st:=EAG_GetCardCredits(ReaderHandle, 0, CardCredits);
if st=0 then
begin
Str(CardCredits div 100,aux);
aux2:=Format('%.02d', [CardCredits mod 100]);
aux:=aux + ',' + aux2;
GetCardCredits:=aux;
end
else GetErrorMessageGen(st,'EAG_GetCardCredits_NOK');
end;
How can I solve this problem ?
Best Regards
Leandro H. Delamare
I'm with a problem a few days with Smart Cards
I Have an C++ DLL with some funcions to read a Smart Card.
But the problem is, I have the declarations in C++ and a Program Example in
Delphi.
I want to make this program with C#
How I Can Import and use the DLL Funcions in My C# Program. Some functions
is working OK, but I have a function called EAG_GetCardCredits doesn't work.
The C++ Declaration is : int WINAPI EAG_GetCardCredits(int iHandle, int
iPurseId, long *lpCardCredits);
In My C# Program I Declarate this way:
[DllImport("Crypto.dll")]
public static unsafe extern int EAG_GetCardCredits(int iHandle, int
iPurseId, out long* lpCardCredits);
The Sample in Delphi is :
Function GetCardCredits(): String;
var st: Integer;
CardCredits: LongInt;
aux,aux2: string;
begin
st:=EAG_GetCardCredits(ReaderHandle, 0, CardCredits);
if st=0 then
begin
Str(CardCredits div 100,aux);
aux2:=Format('%.02d', [CardCredits mod 100]);
aux:=aux + ',' + aux2;
GetCardCredits:=aux;
end
else GetErrorMessageGen(st,'EAG_GetCardCredits_NOK');
end;
How can I solve this problem ?
Best Regards
Leandro H. Delamare