LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CanvasDrawText() fails with code -14

The output of the following code snippet is a line drawn in the canvas control, "CanvasDrawText() failed with code -14", then another line drawn in the canvas control. The panel handle, control ID and all coordinates are valid. Why is CanvasDrawText() failing?

char sMessage[200];
int iRet;
Point TextPoint = {0,0};
Point LinePoint = {0,50};

CanvasDrawLine( pGraphic->phPanel, pGraphic->iControlID,
TextPoint, LinePoint );

iRet = CanvasDrawText( pGraphic->phPanel, pGraphic->iControlID,
"Sample Text", VAL_APP_META_FONT, MakeRect( 20, 30, 150, 200 ),
VAL_CENTER_JUSTIFIED );
if ( iRet < 0 ) {
sprintf( sMessage, "CanvasDrawText() failed with code %i", iRet );
MessagePopup( "Message", sMessage );
} else MessagePopup( "Message", "CanvasDrawText() passed" );

CanvasDrawLine( pGraphic->phPanel, pGraphic->iControlID,
pAxis->Axis.Line.Start, pAxis->Axis.Line.End );
0 Kudos
Message 1 of 2
(2,902 Views)
Hi Glenn,

Please try to refrain from posting duplicate questions. This issue has already been addressed in this thread.

Thank you,

Scott Y
NI
0 Kudos
Message 2 of 2
(2,893 Views)