FontFamily::GetLastStatus method (gdiplusheaders.h)

The FontFamily::GetLastStatus method returns a value that indicates the nature of this FontFamily object's most recent method failure.

Syntax

Status GetLastStatus();

Return value

Type: Status

The FontFamily::GetLastStatus method returns an element of the Status enumeration.

If no methods invoked on this FontFamily object have failed since the previous call to FontFamily::GetLastStatus, then FontFamily::GetLastStatus returns Ok.

If at least one method invoked on this FontFamily object has failed since the previous call to FontFamily::GetLastStatus, then FontFamily::GetLastStatus returns a value that indicates the nature of the most recent failure.

Remarks

You can call FontFamily::GetLastStatus immediately after constructing a FontFamily object to determine whether the constructor succeeded.

The first time you call the FontFamily::GetLastStatus method of a FontFamily object, it returns Ok if the constructor succeeded and all methods invoked so far on the FontFamily object succeeded. Otherwise, it returns a value that indicates the nature of the most recent failure.

Examples

The following example creates a FontFamily object and then checks the status of the call to create the object. If the call was successful, the example draws text.

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

   // Create a FontFamily object.
   FontFamily myFontFamily(L"arial");
   
   // Check the status of the last call.
   Status status = myFontFamily.GetLastStatus();

   // If the last call succeeded, draw text.
   if (status ==Ok)
   {
       SolidBrush solidbrush(Color(255, 0, 0, 0));
       Font       font(&myFontFamily, 16);
       WCHAR      string[] = L"status = Ok";
       graphics.DrawString(string, -1, &font, PointF(0, 0), &solidbrush);
   }
}

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Constructing Font Families and Fonts

FontFamily

Status