kaoh / globalplatform

C library + command-line for Open- / GlobalPlatform smart cards
https://kaoh.github.io/globalplatform/
Other
72 stars 30 forks source link

Using GlobalLibrary.dll in Delphi #59

Closed erdesigns-eu closed 2 years ago

erdesigns-eu commented 2 years ago

Hello, im trying to use the GlobalPlatform.dll with the gppcscconnectionplugin.dll in Delphi. I translated the headers, and i am able to establish a context, connect to the reader - but when i try to select an AID (A000000003000000) i get a error:

select_application() returns 0x80216A82 (6A82: The application to be selected could not be found.)

I can select this AID when i use GPShell, so i know the AID exists. I read that the library uses Unicode (WideString), so for the conversion of the AID string to array of bytes in GPShell - is the array of Bytes 32 (WideChar takes 2 places) long or 16 (AnsiChar takes 1 place)? Because i have tried both but i keep getting the same error message and i cant seem to find out where it goes wrong..

Any help or advice would be verry appreciated

kaoh commented 2 years ago

I guess your issue was solved on Stack Overflow?

erdesigns-eu commented 2 years ago

Yes thank you, im sorry for the troubles. Ill post the solution here for anyone else who might try the same in the future.