Using Win32 functions in Visual FoxPro Image Gallery
Authentication
SCardConnect
SCardControl
SCardDisconnect
SCardEstablishContext
SCardGetAttrib
SCardGetProviderId
SCardIsValidContext
SCardListCards
SCardListInterfaces
SCardListReaderGroups
SCardListReaders
SCardReleaseContext
SCardStatus
SCardTransmit
Code examples:
SCardTransmit
..msdn    Add comment     W32 Constants      Translate this page
Sends a service request to the smart card and expects to receive data back from the card.
Code examples:
Declaration:
LONG SCardTransmit(
  __in     SCARDHANDLE hCard,
  __in     LPCSCARD_IO_REQUEST pioSendPci,
  __in     LPCBYTE pbSendBuffer,
  __in     DWORD cbSendLength,
  __inout  LPSCARD_IO_REQUEST pioRecvPci,
  __out    LPBYTE pbRecvBuffer,
  __inout  LPDWORD pcbRecvLength
);
FoxPro declaration:
DECLARE LONG SCardTransmit IN Winscard;
    INTEGER hCard,;
    STRING pioSendPci,;
    STRING pbSendBuffer,;
    LONG cbSendLength,;
    INTEGER pioRecvPci,;
    STRING @pbRecvBuffer,;
    LONG @pcbRecvLength
Parameters:
hCard [in]
A reference value returned from the SCardConnect function.

pioSendPci [in]
A pointer to the protocol header structure for the instruction.

pbSendBuffer [in]
A pointer to the actual data to be written to the card.

cbSendLength [in]
The length, in bytes, of the pbSendBuffer parameter.

pioRecvPci [in, out]
Pointer to the protocol header structure for the instruction, followed by a buffer in which to receive any returned protocol control information (PCI) specific to the protocol in use. This parameter can be NULL if no PCI is returned.

pbRecvBuffer [out]
Pointer to any data returned from the card.

pcbRecvLength [in, out]
Supplies the length, in bytes, of the pbRecvBuffer parameter and receives the actual number of bytes received from the smart card.
Return value:
Returns SCARD_S_SUCCESS (0) or error code.
Usage:
* selecting Personalization File (FF02)
cSendBuff = CHR(0x80) + CHR(0xA4) + CHR(0x00)+;
        CHR(0x00) + CHR(0x02) +;
        CHR(0xff) + CHR(0x02)

cRecvBuff = REPLICATE(CHR(0), 256)
nRecvLen=2

* protocol=1, structure`s length=8
cIO_REQ = PADR(CHR(1),4,CHR(0)) +;
    PADR(CHR(8),4,CHR(0))

nResult = SCardTransmit(m.hCard, cIO_REQ,;
    PADR(m.cSendBuff, 256, CHR(0)),;
    LEN(m.cSendBuff), 0,;
    @cRecvBuff, @nRecvLen)

cRecvBuff = SUBSTR(m.cRecvBuff,1,m.nRecvLen)

IF nResult = SCARD_S_SUCCESS;
    AND nRecvLen=2 AND ASC(cRecvBuff)=0x90
    * completed successfully
ENDIF
My comment:
Purchase complete VFP solution.
Download ACOS3 Class Library

The SCardTransmit function is a smart card and reader access function.

See also: SCardConnect
Word Index links for the SCardTransmit :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2008-10-24 16:24:13
Modified: 2009-12-15 16:06:39
Visited in last 7 days: 16
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.80.132.10)
7 sec.Function: 'CryptHashData'
14 sec.Function: 'PaintDesktop'
21 sec.Function: 'GetFileNameFromBrowse'
28 sec.
Function group: 'Device Input and Output'
34 sec.Function: 'CeGetFileSize'
42 sec.Function: 'waveOutClose'
50 sec.Function: 'WindowProc'
57 sec.Function: 'DrawMenuBar'
1.05 min.Function: 'ImageList_Create'
1.2 min.Function: 'GetLocaleInfo'
Google
Advertise here!