IInkAnalyzer::GetRecognizedString 메서드

IInkAnalyzer에서 전체 컨텍스트 노드 트리에 대한 인식 작업의 최상의 결과 문자열을 검색합니다.

구문

HRESULT GetRecognizedString(
  [out] BSTR *pbstrRecognizedString
);

매개 변수

pbstrRecognizedString [out]

IInkAnalyzer의 전체 컨텍스트 노드 트리에 대한 인식 작업의 최상의 결과 문자열입니다.

반환 값

반환 값에 대한 설명은 클래스 및 인터페이스 - 잉크 분석을 참조하세요.

설명

주의

메모리 누수 방지를 위해 문자열을 더 이상 사용할 필요가 없는 경우 pbstrRecognizedString에 대해 SysFreeString을 호출합니다.

이 메서드는 인식된 문자열에 대한 루트 노드의 속성 데이터와 동일한 값을 반환합니다. ( IInkAnalyzer::GetRootNode 메서드, IContextNode::GetPropertyData컨텍스트 노드 속성을 참조하세요.)

예제

다음 예제에서는 잉크 분석기 IContextNode 결과 트리를 안내하는 메서드를 보여 줍니다. IInkAnlyzer가 현재 잉크 분석을 수행하지 않는 경우 메서드는 다음을 수행합니다.

  • 상위 인식 문자열을 가져옵니다.
  • 잉크 분석기 루트 노드를 가져옵니다.
  • 도우미 메서드 를 ExploreContextNode호출하여 루트 노드 및 해당 자식 노드를 검사합니다.
// Helper method that explores the current analysis results of an ink analyzer.
HRESULT CMyClass::ExploreAnalysisResults(
    IInkAnalyzer *pInkAnalyzer)
{
    // Check that the ink analyzer is not currently analyzing ink.
    VARIANT_BOOL bIsAnalyzing;
    HRESULT hr = pInkAnalyzer->IsAnalyzing(&bIsAnalyzing);

    if (SUCCEEDED(hr))
    {
        if (bIsAnalyzing)
        {
            return E_PENDING;
        }

        // Get the ink analyzer's best-result string.
        BSTR recognizedString = NULL;
        hr = pInkAnalyzer->GetRecognizedString(&recognizedString);

        if (SUCCEEDED(hr))
        {
            // Insert code that records the ink analyzer's best-result string here.

            // Get the ink analyzer's root node.
            IContextNode *pRootNode = NULL;
            hr = pInkAnalyzer->GetRootNode(&pRootNode);

            if (SUCCEEDED(hr))
            {
                // Call a helper method that recursively explores context
                // nodes and their subnodes.
                hr = this->ExploreContextNode(pRootNode);
            }

            // Release this reference to the root node.
            if (pRootNode != NULL)
            {
                pRootNode->Release();
                pRootNode = NULL;
            }
        }

        // Free the system resources for the recognized string.
        SysFreeString(recognizedString);
    }

    return hr;
}

요구 사항

요구 사항
지원되는 최소 클라이언트
Windows XP 태블릿 PC 버전 [데스크톱 앱만 해당]
지원되는 최소 서버
지원되는 버전 없음
헤더
IACom.h(IACom_i.c도 필요)
DLL
IACom.dll

추가 정보

IInkAnalyzer

잉크 분석 참조