User manual - プリンタライブラリマニュアルver.1.06(2014年6月13日)
Table Of Contents
- 表紙
- プリンタライブラリ.pdf
- 1. 概要
- 2. 動作環境
- 3. 関数
- 3.1 PRNOpen
- 3.2 PRNClose
- 3.3 PRNInitializePrinter
- 3.4 PRNPrintScreen
- 3.5 PRNPrintWindow
- 3.6 PRNTextOut
- 3.7 PRNImageOut
- 3.8 PRNBarcodeOut
- 3.9 PRNBMPOut
- 3.10 PRNCheckMarker
- 3.11 PRNGetStatus
- 3.12 PRNGetLastError
- 3.13 PRNSetPaperWidth
- 3.14 PRNGetPaperWidth
- 3.15 PRNSetPrinterProperty
- 3.16 PRNGetPrinterProperty
- 3.17 PRNDecodeBarcode
- 3.18 PRNResetDecoder
- 3.19 PRNSetBarcodeType
- 3.20 PRNGetBarcodeType
- 4. プログラミング上の注意点
- 5. ESCコマンド
- 6. DeviceEmulator
- 裏表紙(他のマニュアル用)

50
DWORD dwReadNum, dwSize;
BYTE *pbData;
hFile = CreateFile(L"\\Image.bin", GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
MessageBox(NULL, L"File not found", L"Error", MB_OK);
return;
}
dwSize = IMAGE_WIDTH * IMAGE_HEIGHT;
pbData = (BYTE *)LocalAlloc(0, dwSize);
if (pbData == NULL)
{
MessageBox(NULL, L"Failed to get memory", L"Error", MB_OK);
CloseHandle(hFile);
return;
}
if (!ReadFile(hFile, pbData, dwSize, &dwReadNum, NULL))
{
MessageBox(NULL, L"Failed to read file", L"Error", MB_OK);
LocalFree(pbData);
CloseHandle(hFile);
return;
}
CloseHandle(hFile);
if (PRNOpen() != PRN_NORMAL)
{
MessageBox(NULL, L"Open error", L"Error", MB_OK);
LocalFree(pbData);
return;
}
if (PRNTextOut(3, ESCR) != PRN_NORMAL)
{
if (CheckError() != TRUE)
{
PRNClose();
LocalFree(pbData);
return;
}
}
if (PRNImageOut(IMAGE_WIDTH, IMAGE_HEIGHT, FEED_LENGTH, pbData) != PRN_NORMAL)
{
if (CheckError() != TRUE)
{
PRNClose();