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:
SCardControl
..msdn    Add comment     W32 Constants      Translate this page
The SCardControl function gives you direct control of the reader by sending specific control codes optionally accompanied with supporting input data.
Code examples:
Declaration:
LONG SCardControl(
  __in   SCARDHANDLE hCard,
  __in   DWORD dwControlCode,
  __in   LPCVOID lpInBuffer,
  __in   DWORD nInBufferSize,
  __out  LPVOID lpOutBuffer,
  __in   DWORD nOutBufferSize,
  __out  LPDWORD lpBytesReturned
);
FoxPro declaration:
DECLARE LONG SCardControl IN Winscard;
    INTEGER hCard,;
    LONG dwControlCode,;
    STRING lpInBuffer,;
    LONG nInBufferSize,;
    STRING @lpOutBuffer,;
    LONG nOutBufferSize,;
    LONG @lpBytesReturned
Parameters:
hCard [in]
Reference value returned from SCardConnect.

dwControlCode [in]
Control code for the operation. This value identifies the specific operation to be performed.

lpInBuffer [in]
Pointer to a buffer that contains the data required to perform the operation.

nInBufferSize [in]
Size, in bytes, of the buffer pointed to by lpInBuffer.

lpOutBuffer [out]
Pointer to a buffer that receives the operation"s output data.

nOutBufferSize [in]
Size, in bytes, of the buffer pointed to by lpOutBuffer.

lpBytesReturned [out]
Pointer to a DWORD that receives the size, in bytes, of the data stored into the buffer pointed to by lpOutBuffer.
Return value:
Returns SCARD_S_SUCCESS (0) or error code.
Usage:
FUNCTION SendCardControlCode(nCtrlCode As Number,;
    nRecvLen as Number) As Boolean

    LOCAL nResult, cRecvBuff, nRetLen
    STORE REPLI(CHR(0), m.nRecvLen) TO cRecvBuff
    nRetLen=0

    nResult = SCardControl(THIS.hCard, m.nCtrlCode,;
        THIS.SendBuff, LEN(THIS.SendBuff),;
        @cRecvBuff, nRecvLen, @nRetLen)

    IF nResult = SCARD_S_SUCCESS
        THIS.RecvBuff = SUBSTR(m.cRecvBuff,1,m.nRetLen)
    ELSE
        THIS.SetError(m.nResult, "SCardControl failed")
    ENDIF
RETURN (nResult=SCARD_S_SUCCESS)
My comment:
You can call it any time after a successful call to SCardConnect and before a successful call to SCardDisconnect. The effect on the state of the reader depends on the control code.
Word Index links for the SCardControl :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2008-11-20 14:15:28
Modified: 2008-11-20 14:28:50
Visited in last 7 days: 8
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.158.214.111)
2 sec.Articles
3 sec.Function: 'AVIStreamGetFrameOpen'
Function group: 'Windows Multimedia'
5 sec.Function: 'mixerGetNumDevs'
Function group: 'Windows Multimedia'
8 sec.
12 sec.Solutions
13 sec.
Function group: 'Atom'
15 sec.Function: 'GetSystemInfo'
Function group: 'System Information'
18 sec.Example: 'Accessing examples contained in this reference from a VFP application'
22 sec.Function: 'NetConnectionEnum'
Function group: 'Network Management'
24 sec.Function: 'AVIStreamGetFrameClose'
Function group: 'Windows Multimedia'
Google
Advertise here!