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:
Smart Card Database Query Functions
SCardEstablishContext
..msdn    Add comment     W32 Constants      Translate this page
Establishes the resource manager context (the scope) within which database operations are performed.
Code examples:
Smart Card Database Query Functions
Declaration:
LONG SCardEstablishContext(
    __in   DWORD dwScope,
    __in   LPCVOID pvReserved1,
    __in   LPCVOID pvReserved2,
    __out  LPSCARDCONTEXT phContext
);
FoxPro declaration:
DECLARE LONG SCardEstablishContext IN Winscard;
    INTEGER dwScope,;
    INTEGER pvReserved1,;
    INTEGER pvReserved2,;
    INTEGER @phContext
Parameters:
dwScope [in]
Scope of the resource manager context.

pvReserved1 [in]
Reserved for future use and must be NULL.

pvReserved2 [in]
Reserved for future use and must be NULL.

phContext [out]
A handle to the established resource manager context.
Return value:
If the function succeeds, the function returns SCARD_S_SUCCESS (0).
Usage:
#DEFINE SCARD_SCOPE_USER 0
#DEFINE SCARD_SCOPE_SYSTEM 2
#DEFINE SCARD_S_SUCCESS 0

LOCAL hContext
hContext=0

IF SCardEstablishContext(SCARD_SCOPE_USER, 0, 0,;
    @hContext) <> SCARD_S_SUCCESS
    RETURN
ENDIF

...
= SCardReleaseContext(m.hContext)
My comment:
Purchase complete VFP solution.
Download ACOS3 Class Library

Upon successful call the phContext handle can be supplied to other functions attempting to do work within this context.

The error code SCARD_E_NO_SERVICE (0x8010001D), "The smart card resource manager is not running", means that the SCardSvr service is not started. By default this service is stopped.



The error code SCARD_E_NO_READERS_AVAILABLE (0x8010002E) speaks for itself.

See also: SCardReleaseContext
Word Index links for the SCardEstablishContext :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2008-10-08 14:52:48
Modified: 2009-12-15 16:05:49
Visited in last 7 days: 18
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2014 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.1.68), 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.180.41)
3 sec.Example: 'Displaying dimmed window behind VFP top-level form'
8 sec.Example: 'How to change display settings: screen resolution, screen refresh rate'
Language: 'C#'
2 day(s)Function: 'CryptProtectData'
Function group: 'Cryptography Reference'
Google
Advertise here!