Skip to content

Latest commit

 

History

History
121 lines (91 loc) · 4.12 KB

nf-gdipluspen-pen-getlaststatus.md

File metadata and controls

121 lines (91 loc) · 4.12 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist req.product ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:gdipluspen.Pen.GetLastStatus
Pen::GetLastStatus (gdipluspen.h)
The Pen::GetLastStatus method returns a value that indicates the nature of this Pen object's most recent method failure.
GetLastStatus
GetLastStatus method [GDI+]
GetLastStatus method [GDI+]
Pen class
Pen class [GDI+]
GetLastStatus method
Pen.GetLastStatus
Pen::GetLastStatus
_gdiplus_CLASS_Pen_GetLastStatus_
gdiplus._gdiplus_CLASS_Pen_GetLastStatus_
gdiplus\_gdiplus_CLASS_Pen_GetLastStatus_.htm
gdiplus
VS|gdicpp|~\gdiplus\gdiplusreference\classes\penclass\penmethods\getlaststatus_88.htm
12/05/2018
GetLastStatus, GetLastStatus method [GDI+], GetLastStatus method [GDI+],Pen class, Pen class [GDI+],GetLastStatus method, Pen.GetLastStatus, Pen::GetLastStatus, _gdiplus_CLASS_Pen_GetLastStatus_, gdiplus._gdiplus_CLASS_Pen_GetLastStatus_
gdipluspen.h
Gdiplus.h
Windows
Windows XP, Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Gdiplus.lib
Gdiplus.dll
Windows
GDI+ 1.0
19H1
Pen::GetLastStatus
gdipluspen/Pen::GetLastStatus
c++
APIRef
kbSyntax
COM
Gdiplus.dll
Pen.GetLastStatus

Pen::GetLastStatus

-description

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

-returns

Type: Status

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

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

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

-remarks

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

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

Examples

The following example creates a Pen object, sets the dash style, and draws a dashed line. The code then checks the status of the method that sets the dash style for the pen.

VOID Example_GetLastStatus(HDC hdc)
{
   Graphics graphics(hdc);
   
   // Create a pen.
   Pen pen(Color(255, 255, 0, 0), 5);

   // Set the dash style, and draw a dashed line.
   pen.SetDashStyle(DashStyleDash);
   graphics.DrawLine(&pen, 0, 0, 200, 100);

   // Check the status of the method that sets the dash style for the pen.
   Status status = pen.GetLastStatus();

   if(status == Ok)
   {
      // The call to SetDashStyle was successful.
   }
   else
   {
      // There was a problem with the call to SetDashStyle.
   }
}

-see-also

Pen

Status