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:
SCardStatus
..msdn    Add comment     W32 Constants      Translate this page
Provides the current status of a smart card in a reader.
Code examples:
Declaration:
LONG SCardStatus(
  __in     SCARDHANDLE hCard,
  __out    LPTSTR szReaderName,
  __inout  LPDWORD pcchReaderLen,
  __out    LPDWORD pdwState,
  __out    LPDWORD pdwProtocol,
  __out    LPBYTE pbAtr,
  __inout  LPDWORD pcbAtrLen
);

FoxPro declaration:
DECLARE LONG SCardStatus IN Winscard;
    INTEGER hCard,;
    STRING @szReaderName,;
    LONG @pcchReaderLen,;
    LONG @pdwState,;
    LONG @pdwProtocol,;
    STRING @pbAtr,;
    LONG @pcbAtrLen
Parameters:
hCard [in]
Reference value returned from SCardConnect.

szReaderName [out]
List of display names (multiple string) by which the currently connected reader is known.

pcchReaderLen [in, out]
On input, supplies the length of the szReaderName buffer.

pdwState [out]
Current state of the smart card in the reader.

pdwProtocol [out]
Current protocol, if any.

pbAtr [out]
Pointer to a 32-byte buffer that receives the ATR string from the currently inserted card, if available.

pcbAtrLen [in, out]
On input, supplies the length of the pbAtr buffer. On output, receives the number of bytes in the ATR string (32 bytes maximum).
Return value:
Returns SCARD_S_SUCCESS (0) or error code.
Usage:
nReaderNamesLen=512
cReaderNames = REPLICATE(CHR(0), nReaderNamesLen)
nAttribLen=33
cATR = REPLICATE(CHR(0), nAttribLen)
STORE 0 TO nState, nProtocol

nResult = SCardStatus(hCard, @cReaderNames,;
    @nReaderNamesLen, @nState, @nProtocol,;
    @cATR, @nAttribLen)

IF (nResult=SCARD_S_SUCCESS)
    cReaderName = PADR(m.cReaderNames,;
        m.nReaderNamesLen-1)

    cATR = PADR(m.cATR, m.nAttribLen)
ENDIF
My comment:
You can call it any time after a successful call to SCardConnect and before a successful call to SCardDisconnect.
Word Index links for the SCardStatus :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2008-10-28 15:27:54
Modified: 2008-10-28 15:35:11
Visited in last 7 days: 15
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.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.163.61.66)
24 sec.
Function group: 'Shell Lightweight Utility APIs -- string functions'
46 sec.Function: 'DestroyPhysicalMonitors'
1.28 min.Function: 'htonl'
2.82 min.Function: 'keybd_event'
Google
Advertise here!