Hi friends,
I need to integrate a smart card reader with my clarion application.
Windows 10 have default Winscard.dll
Thus i made a library out of it and need to call the following 2 lines: SCardListReaders and SCardConnect
MSDN list out the prototype as follows:-
LONG WINAPI SCardListReaders(
_In_ SCARDCONTEXT hContext,
_In_opt_ LPCTSTR mszGroups,
_Out_ LPTSTR mszReaders,
_Inout_ LPDWORD pcchReaders
);
LONG WINAPI SCardConnect(
_In_ SCARDCONTEXT hContext,
_In_ LPCTSTR szReader,
_In_ DWORD dwShareMode,
_In_ DWORD dwPreferredProtocols,
_Out_ LPSCARDHANDLE phCard,
_Out_ LPDWORD pdwActiveProtocol
);
Inside the clarion global map, i put the following:-
module('Winscard.dll')
SCardConnect(unsigned,long,ulong,ulong,unsigned,unsigned),ulong,PASCAL,proc
SCardListReaders(unsigned,long,long,ulong),ulong,PASCAL,proc
end
Then in a procedure, i populate a button and in the embed, i put the following:-
LOC:Value = SCardConnect(hSC, ReaderName, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, hCard, dProtocol)
i create a local data for the following:-
hsc - string
ReaderName string
hcard - long
dprotocol - long
i compile it and get error message.
i am sure i am doing it wrong. what should i correct? please guide
thanks
Jason
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 26:08:47 |
Calls: | 6,646 |
Calls today: | 1 |
Files: | 12,193 |
Messages: | 5,327,879 |