다음을 통해 공유


FontCollection::GetLastStatus 메서드(gdiplusheaders.h)

FontCollection::GetLastStatus 메서드는 이 FontCollection 개체의 이전 메서드 호출 결과를 나타내는 값을 반환합니다.

구문

Status GetLastStatus();

반환 값

형식: 상태

FontCollection::GetLastStatus 메서드는 Status 열거형의 요소를 반환합니다.

FontCollection 개체에서 호출된 이전 메서드가 성공하면 FontCollection::GetLastStatus 는 확인을 반환합니다.

이전 메서드가 실패한 경우 FontCollection::GetLastStatus 는 실패의 특성을 나타내는 상태 열거형의 다른 요소 중 하나를 반환합니다.

설명

FontCollection 개체를 생성한 직후 FontCollection::GetLastStatus를 호출하여 생성자가 성공했는지 여부를 확인할 수 있습니다. FontCollection::GetLastStatus 는 생성자가 성공하면 확인을 반환합니다. 그렇지 않으면 실패의 특성을 나타내는 값을 반환합니다.

FontFontCollection 클래스에서 FontCollection::GetLastStatus의 구현은 다른 클래스에서 이 메서드의 구현과 다릅니다. 또한 Font 클래스의 FontCollection::GetLastStatus 구현은 FontCollection 클래스의 FontCollection::GetLastStatus 구현과 다릅니다.

예제

다음 예제에서는 PrivateFontCollection 개체를 만들고, 메서드 호출의 상태 확인하고, 성공하면 텍스트를 그립니다.

VOID Example_GetLastStatus(HDC hdc)
{
   Graphics graphics(hdc);

   // Create a PrivateFontCollection object, and add three families.
   PrivateFontCollection fontCollection;
   fontCollection.AddFontFile(L"C:\\WINNT\\Fonts\\Arial.ttf");
   fontCollection.AddFontFile(L"C:\\WINNT\\Fonts\\CourBI.ttf");
   fontCollection.AddFontFile(L"C:\\WINNT\\Fonts\\TimesBd.ttf");

   // Create an array to hold the font families, and get the font families of
   // fontCollection.
   FontFamily families[3];
   int numFamilies;
   fontCollection.GetFamilies(3, families, &numFamilies);

   // Verify that the call to GetFamilies was successful.
   Status status = fontCollection.GetLastStatus();

   // If the call was successful, draw text.
   if (status == Ok)
   {
      // Create a Font object from the first FontFamily object in the array.
      Font myFont(&families[0], 16);

      // Use myFont to draw text.
      SolidBrush solidbrush(Color(255, 0, 0, 0));
      WCHAR string[] = L"The call was successful";
      graphics.DrawString(string,
                          23, &myFont, PointF(0, 0), &solidbrush);
   }
}

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows XP, Windows 2000 Professional [데스크톱 앱만 해당]
지원되는 최소 서버 Windows 2000 Server[데스크톱 앱만]
대상 플랫폼 Windows
헤더 gdiplusheaders.h(Gdiplus.h 포함)
라이브러리 Gdiplus.lib
DLL Gdiplus.dll

추가 정보

FontCollection

PrivateFontCollection

텍스트 및 글꼴 사용