Determines the validity of the class object's paint handle.
#include "Ltwrappr.h"
L_INT LRasterPaint::IsValid()
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes |
The paint handle will be valid after calling LRasterPaint::Initialize, and will remain valid until LRasterPaint::Free is called.
The paint handle is a private member of the LRasterPaint class object. For more information about the paint handle, refer to the PAINTHANDLE structure.
L_INT LRasterPaint_IsValidExample( LRasterPaint rstp, CWnd* pWnd )
{
L_INT nRet;
nRet = rstp.IsValid ();
if(nRet == SUCCESS)
{
CDC* pDC = pWnd->GetDC();
RECT rcShape;
/* Set the coordinates with respect to the DC dimensions*/
SetRect ( &rcShape, 10, 10, 150, 150 ) ;
/* Use the current shape properties to draw an ellipse*/
nRet = rstp.DrawShapeEllipse ( pDC->m_hDC, &rcShape ) ;
if(nRet != SUCCESS)
return nRet;
pWnd->ReleaseDC( pDC ) ;
}
else
{
pWnd->MessageBox (TEXT("Invalid PAINTHANDLE"), TEXT("Error"), MB_OK ) ;
return nRet;
}
return SUCCESS ;
}