共用方式為


ISCard::get_CoNtext 方法

[ get_CoNtext 方法可用於需求一節中指定的作業系統。 它不適用於 Windows Server 2003 service Pack 1 (SP1) 及更新版本、Windows Vista、Windows Server 2008 和後續版本的作業系統。 智慧卡模組提供類似的功能。

get_CoNtext方法會擷取目前的Resource Manager 內容控制碼。 如果尚未建立任何內容,這個方法會傳回 (*pCoNtext) == Null

語法

HRESULT get_Context(
  [out] HSCARDCONTEXT *pContext
);

參數

pCoNtext [out]

傳回時內容控制碼的指標。

傳回值

方法會傳回下列其中一個可能的值。

傳回碼 描述
S_OK
作業順利完成。
E_INVALIDARG
pCoNtext參數無效。
E_POINTER
pCoNtext中傳遞了不正確的指標。

 

備註

資源管理員內容是藉由呼叫 智慧卡 函式 SCardEstablishCoNtext來設定。

除了上述 COM 錯誤碼之外,如果呼叫智慧卡函式來完成要求,此介面可能會傳回智慧卡錯誤碼。 如需詳細資訊,請參閱 智慧卡傳回值

範例

下列範例顯示擷取目前的 Resource Manager 內容 控制碼。

HSCARDCONTEXT  hCtx;
HRESULT        hr;

// Retrieve the smart card context.
hr = pISCard->get_Context(&hCtx);
if (FAILED(hr))
{
   printf("Failed get_Context\n");
   // Take other error handling action as needed.
}
// Use smart card context as needed.

規格需求

需求
最低支援的用戶端
Windows XP [僅限傳統型應用程式]
最低支援的伺服器
Windows Server 2003 [僅限傳統型應用程式]
用戶端支援結束
Windows XP
伺服器終止支援
Windows Server 2003
標頭
Scardmgr.h
類型程式庫
Scardmgr.tlb
DLL
Scardssp.dll
IID
IID_ISCard定義為 1461AAC3-6810-11D0-918F-00AA00C18068

另請參閱

get_Atr

get_CardHandle

get_Protocol

get_Status

ISCard

SCardEstablishCoNtext