Return values, Example – Avery Dennison 6035 Programmer Manual Rev.CA 6/01 User Manual

Page 76

Advertising
background image

Function Reference 4-35

Return Values

0

Successful.

-1

Memory allocation error.

703-793

A motion control error occurred. After the operator
corrects the printer condition, the applic ation must
call pclClearError to reset the Motion Control
subsystem. Refer to the MPCLII Packet Reference
Manual
for more information.


Example

#include <conio.h>

#include <malloc.h>

#include <stdio.h>

#include "mmsultra.h"

void main(void)

{

PRINTINIT pPrintparms;

// Print data structure

short sStatus = 0;

// Status of comm. calls

// Start Print subsystem

pPrintparms.lpuchFntAddr = (unsigned char far

*)malloc(16384);

pPrintparms.ulFntSize = 16384;

sStatus = pcl

I

nit(&pPrintparms);

switch(sStatus)

{

case 0: ; /* Branch to printing routine */

break;

case -1: printf("Memory Allocation Error");

break;

default: printf("Error-- press any key when reset.");

_getch();

pclClearError();

}

pclClose();

// Close Print subsystem

free(pPrintparms.lpuchFntAddr);

// Free allocated memory

}

Advertising