Co de 39
Nugget
Operating the Terminal in a Network
4-35
4
CLIENT.CPP Sample Application for a TCP/IP Direct Connect Network (continued)
+;
printf("receive failed %d\n", Rcount);
ErrorMessage("receive", WSAGetLastError());
bConnectionAlive = FALSE;
}
// printf the converted string
printf("response:%s\n",rz);
printf("\n> ");
Sleep(1000);
}
else
bConnectionAlive = FALSE;
}
// release the resources held by the socket
error = closesocket(connection);
if (error != 0)
ErrorMessage("closesocket", WSAGetLastError());
// release the resources held by the socket library
error = WSACleanup();
if (error != 0)
ErrorMessage("WSACleanup", WSAGetLastError());
return 0;
}
UTILS.H Utility (Used by CLIENT.CPP)
#include <windows.h>
inline void ErrorMessage(LPCTSTR szFn, DWORD dwError = GetLastError())
{
TCHAR szTitle[1024];
TCHAR szPrompt[1024];
BOOL bRet = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
0, dwError,
0,
szPrompt,
sizeof(szPrompt),
0);
if (!bRet)
lstrcpy(szPrompt, __TEXT("Unknown Error"));
wsprintf(szTitle, __TEXT("%s failed with error code (0x%x)!"), szFn, dwError);
int id = MessageBox(HWND_DESKTOP, szPrompt, szTitle,
MB_ABORTRETRYIGNORE|MB_SETFOREGROUND);
if (id != IDIGNORE)
ExitProcess(0);
}
Summary of Contents for Trakker Antares 2420
Page 1: ...TRAKKERAntares 2420and2425 Hand HeldTerminal P N 064024 006 User s Manual...
Page 15: ...nuggetf code39 Contents xv Glossary Index G I...
Page 16: ...xvi...
Page 24: ...xxiv...
Page 25: ...nuggetf code39 Getting Started 1...
Page 26: ...1 2...
Page 60: ...1 36...
Page 61: ...Learning How to Use the Terminal 2...
Page 62: ...2 2...
Page 103: ...Co de 39 Nugget Configuring the Terminal 3...
Page 104: ...Co de 39 Nugget 3 2...
Page 134: ...3 32...
Page 135: ...Operating the Terminal in a Network 4...
Page 136: ...4 2...
Page 173: ...Using Custom Applications 5...
Page 174: ...5 2...
Page 193: ...Troubleshooting 6...
Page 194: ...6 2...
Page 219: ...Running Diagnostics 7...
Page 220: ...7 2...
Page 243: ...Reader Command Reference 8...
Page 244: ...8 2...
Page 268: ...8 26...
Page 269: ...Configuration Command Reference 9...
Page 270: ...9 2...
Page 389: ...Terminal Specifications A...
Page 390: ...A 2...
Page 404: ...A 16...
Page 405: ...Full ASCII Charts B...
Page 406: ...B 2...
Page 415: ...International Character Support C...
Page 416: ...C 2...
Page 427: ...Using the Default Applications D...
Page 428: ...D 2...
Page 438: ...D 12...
Page 439: ...Glossary G...
Page 440: ...G 2...
Page 463: ...Index I...
Page 464: ...I 2...
Page 480: ...I 18...