Statistics
| Revision:

svn-gvsig-desktop / tags / v1_9_Build_1237 / libraries / libjni-ecwcompress / include / NCSErrors.h @ 43300

History | View | Annotate | Download (31.3 KB)

1
/********************************************************
2
** Copyright 1999 Earth Resource Mapping Pty Ltd.
3
** This document contains unpublished source code of
4
** Earth Resource Mapping Pty Ltd. This notice does
5
** not indicate any intention to publish the source
6
** code contained herein.
7
**
8
** FILE:           NCSError.h
9
** CREATED:        Thu Feb 25 09:19:00 WST 1999
10
** AUTHOR:         Simon Cope
11
** PURPOSE:        NCS Error handling enum/routines.
12
** EDITS:
13
   [01] ny        26Apr00 Added         NCS_NET_PACKET_RECV_ZERO_LENGTH error 
14
   [02] sjc 30May00 Merge Mac SDK port in to main source stream
15
   [03] ny  12May00 Added lost of connection error
16
   [04] ny  07Jul00 Added Metabase query errors
17
   [05] ny  19Jul00 Added Timeout errors
18
   [06] mjs 25Aug00 Added errors for Java JNI functionality
19
   [07] jmp 31Aug00 Moved extra symbol server errors to end of enum
20
   [08] sjc 12Oct00 Added NCS_MAX_ERROR_NUMBER to enable range check
21
   [10]  ny        30Oct00        Merge WinCE/Palm SDK
22
   [11] rar        19Jan01 Mac port changes
23
   [12] sjc 06Mar01 Strings were swapped
24
   [13] jmp 17May01 Added SetExtents error
25
   [14] jmp 25Sep01 Layer errors
26
   [15] ajd 22Nov01 added 1.65 gdt errors
27
   [16] ajd 15Jan02 added NCS_GDT_TRANSFORM_OUT_OF_BOUNDS
28
   [17]        jmp 17Jan02 Layer errors
29
   [18] jmp 24Apr02 Layer Parameter Errors
30
   [19] mjs 15Nov02 Added PIPE errors for CGI server
31
   [20] rar 20Nov02        Added errors for NCSMakeDir
32
 *******************************************************/
33

    
34

    
35
#ifndef NCSERRORS_H
36
#define NCSERRORS_H
37

    
38
#ifdef __cplusplus
39
extern "C" {
40
#endif
41

    
42
#ifndef NCSDEFS_H
43
#include "NCSDefs.h"
44
#endif
45

    
46
#if (defined(WIN32) && !defined(_WIN32_WCE))/*||defined(MACINTOSH)*/ /**[10]**/
47
#include <crtdbg.h>
48
#else
49
#define _CRT_WARN 1
50
#if !defined(_DEBUG) && !defined(DEBUG)
51
#ifndef _ASSERT
52
#define _ASSERT(a)
53
#endif
54
#define _RPT0(a, b)
55
#define _RPT1(a, b, a1)
56
#define _RPT2(a, b, a1, a2)
57
#define _RPT3(a, b, a1, a2, a3)        
58
#define _RPT4(a, b, a1, a2, a3, a4)
59
#else        /* _DEBUG */
60
#ifndef _ASSERT
61
#define _ASSERT(a)
62
#endif
63
#define _RPT0(a, b)                                        fprintf(stderr, b)
64
#define _RPT1(a, b, a1)                                fprintf(stderr, b, a1)
65
#define _RPT2(a, b, a1, a2)                        fprintf(stderr, b, a1, a2)
66
#define _RPT3(a, b, a1, a2, a3)                fprintf(stderr, b, a1, a2, a3)
67
#define _RPT4(a, b, a1, a2, a3, a4)        fprintf(stderr, b, a1, a2, a3, a4)
68
#endif        /* _DEBUG */
69
#endif        /* WIN32 || MACINTOSH */
70

    
71
#ifdef PALM
72
#include <PalmTypes.h>
73
#include <FileStream.h>
74
#endif
75

    
76
/*
77
** Error Enum.
78
*/
79

    
80
/*
81
** IMPORTANT: Add new errors to the end of this list so we can retain some 
82
**                          backwards binary compatibilty. Also, don't forget to add the 
83
**                          error text!
84
*/
85

    
86
/** 
87
 *        @enum
88
 *        An enumerated type specifying all the errors associated with the SDK.  Each error
89
 *        code is associated with a string of explanatory text.
90
 */
91
typedef enum {
92
        /* NCS Raster Errors */
93
        NCS_SUCCESS                                        = 0,                /**< No error */
94
        NCS_QUEUE_NODE_CREATE_FAILED,                        /**< Queue node creation failed */
95
        NCS_FILE_OPEN_FAILED,                                        /**< File open failed */
96
        NCS_FILE_LIMIT_REACHED,                                        /**< The Image Web Server's licensed file limit has been reached */
97
        NCS_FILE_SIZE_LIMIT_REACHED,                        /**< The requested file is larger than is permitted by the license on this Image Web Server */
98
        NCS_FILE_NO_MEMORY,                                                /**< Not enough memory for new file */
99
        NCS_CLIENT_LIMIT_REACHED,                                /**< The Image Web Server's licensed client limit has been reached */
100
        NCS_DUPLICATE_OPEN,                                                /**< Detected duplicate open from net layer */
101
        NCS_PACKET_REQUEST_NYI,                                        /**< Packet request type not yet implemented */
102
        NCS_PACKET_TYPE_ILLEGAL,                                /**< Packet type is illegal */
103
        NCS_DESTROY_CLIENT_DANGLING_REQUESTS,        /**< Client closed while requests outstanding */
104

    
105
        /* NCS Network Errors */
106
        NCS_UNKNOWN_CLIENT_UID,                                        /**< Client UID unknown */
107
        NCS_COULDNT_CREATE_CLIENT,                                /**< Could not create new client */
108
        NCS_NET_COULDNT_RESOLVE_HOST,                        /**< Could not resolve address of Image Web Server */
109
        NCS_NET_COULDNT_CONNECT,                                /**< Could not connect to host */
110
        NCS_NET_RECV_TIMEOUT,                                        /**< Receive timeout */
111
        NCS_NET_HEADER_SEND_FAILURE,                        /**< Error sending header */
112
        NCS_NET_HEADER_RECV_FAILURE,                        /**< Error receiving header */
113
        NCS_NET_PACKET_SEND_FAILURE,                        /**< Error sending packet */
114
        NCS_NET_PACKET_RECV_FAILURE,                        /**< Error receiving packet */
115
        NCS_NET_401_UNAUTHORISED,                                /**< 401 Unauthorised: SDK doesn't do authentication so this suggests a misconfigured server */                        
116
        NCS_NET_403_FORBIDDEN,                                        /**< 403 Forbidden: could be a 403.9 from IIS or PWS meaning that the maximum simultaneous request limit has been reached */
117
        NCS_NET_404_NOT_FOUND,                                        /**< 404 Not Found: this error suggests that the server hasn't got Image Web Server installed */
118
        NCS_NET_407_PROXYAUTH,                                        /**< 407 Proxy Authentication: the SDK doesn't do proxy authentication yet either, so this also suggests misconfiguration */
119
        NCS_NET_UNEXPECTED_RESPONSE,                        /**< Unexpected HTTP response could not be handled */
120
        NCS_NET_BAD_RESPONSE,                                        /**< HTTP response received outside specification */
121
        NCS_NET_ALREADY_CONNECTED,                                /**< Already connected */
122
        NCS_INVALID_CONNECTION,                                        /**< Connection is invalid */
123
        NCS_WINSOCK_FAILURE,                                        /**< A Windows sockets failure occurred */
124

    
125
        /* NCS Symbol Errors */
126
        NCS_SYMBOL_ERROR,                        /**< Symbology error */
127
        NCS_OPEN_DB_ERROR,                        /**< Could not open database */
128
        NCS_DB_QUERY_FAILED,                /**< Could not execute the requested query on database */
129
        NCS_DB_SQL_ERROR,                        /**< SQL statement could not be executed */
130
        NCS_GET_LAYER_FAILED,                /**< Open symbol layer failed */
131
        NCS_DB_NOT_OPEN,                        /**< The database is not open */
132
        NCS_QT_TYPE_UNSUPPORTED,        /**< This type of quadtree is not supported */
133

    
134
        /* Preference errors */
135
        NCS_PREF_INVALID_USER_KEY,                /**< Invalid local user key name specified */
136
        NCS_PREF_INVALID_MACHINE_KEY,        /**< Invalid local machine key name specified */
137
        NCS_REGKEY_OPENEX_FAILED,                /**< Failed to open registry key */
138
        NCS_REGQUERY_VALUE_FAILED,                /**< Registry query failed */
139
        NCS_INVALID_REG_TYPE,                        /**< Type mismatch in registry variable */
140

    
141
        /* Misc Errors */
142
        NCS_INVALID_ARGUMENTS,                /**< Invalid arguments passed to function */
143
        NCS_ECW_ERROR,                                /**< ECW error */
144
        /* unspecified, but coming out of ecw */
145
        NCS_SERVER_ERROR,                        /**< Server error */
146
        /* unspecified server error */
147
        NCS_UNKNOWN_ERROR,                        /**< Unknown error */
148
        NCS_EXTENT_ERROR,                        /**< Extent conversion failed */
149
        NCS_COULDNT_ALLOC_MEMORY,        /**< Could not allocate enough memory */
150
        NCS_INVALID_PARAMETER,                /**< An invalid parameter was used */
151

    
152
        /* Compression Errors */
153
        NCS_FILEIO_ERROR,                                                /**< Error reading or writing file */
154
        NCS_COULDNT_OPEN_COMPRESSION,                        /**< Compression task could not be initialised */
155
        NCS_COULDNT_PERFORM_COMPRESSION,                /**< Compression task could not be processed */
156
        NCS_GENERATED_TOO_MANY_OUTPUT_LINES,        /**< Trying to generate too many output lines */
157
        NCS_USER_CANCELLED_COMPRESSION,                        /**< Compression task was cancelled by client application */
158
        NCS_COULDNT_READ_INPUT_LINE,                        /**< Could not read line from input data */
159
        NCS_INPUT_SIZE_EXCEEDED,                                /**< Input image size was exceeded for this version of the SDK */
160

    
161
        /* Decompression Errors */
162
        NCS_REGION_OUTSIDE_FILE,        /**< Specified image region is outside image extents */
163
        NCS_NO_SUPERSAMPLE,                        /**< Supersampling is not supported by the SDK functions */
164
        NCS_ZERO_SIZE,                                /**< Specified image region has a zero width or height */
165
        NCS_TOO_MANY_BANDS,                        /**< More bands specified than exist in the input file */
166
        NCS_INVALID_BAND_NR,                /**< An invalid band number has been specified */
167

    
168
        /* NEW Compression Error */
169
        NCS_INPUT_SIZE_TOO_SMALL,        /**< Input image size is too small to compress - for ECW compression there is a minimum output file size */
170

    
171
        /* NEW Network error */
172
        NCS_INCOMPATIBLE_PROTOCOL_VERSION,        /**< The ECWP client version is incompatible with this server */
173
        NCS_WININET_FAILURE,                                /**< Windows Internet Client error */
174
        NCS_COULDNT_LOAD_WININET,                        /**< wininet.dll could not be loaded - usually indicates Internet Explorer should be upgraded */
175

    
176
        /* NCSFile && NCSRenderer class errors */
177
        NCS_FILE_INVALID_SETVIEW,                        /**< The parameters specified for setting a file view were invalid, or the view was not set */
178
        NCS_FILE_NOT_OPEN,                                        /**< No file is open */
179
        
180
        /* NEW JNI Java Errors */
181
        NCS_JNI_REFRESH_NOT_IMPLEMENTED,        /**< Class does not implement ECWProgressiveDisplay interface */
182
        /* A class is trying to use RefreshUpdate() method, but has not implemented ECWProgressiveDisplay*/
183

    
184
        /* NEW Coordinate Errors*/
185
        NCS_INCOMPATIBLE_COORDINATE_SYSTEMS,        /**< Incompatible coordinate systems */
186
        NCS_INCOMPATIBLE_COORDINATE_DATUM,                /**< Incompatible coordinate datum types */
187
        NCS_INCOMPATIBLE_COORDINATE_PROJECTION,        /**< Incompatible coordinate projection types */
188
        NCS_INCOMPATIBLE_COORDINATE_UNITS,                /**< Incompatible coordinate units types */
189
        NCS_COORDINATE_CANNOT_BE_TRANSFORMED,        /**< Non-linear coordinate systems not supported */
190
        NCS_GDT_ERROR,                                                        /**< Error involving the GDT database */
191
        
192
        /* NEW NCScnet error */
193
        NCS_NET_PACKET_RECV_ZERO_LENGTH,        /**< Zero length packet received */
194
        /**[01]**/
195
        
196
        /* Macintosh SDK specific errors */
197
        NCS_UNSUPPORTEDLANGUAGE,                        /**< Must use Japanese version of the ECW SDK */
198
        /**[02]**/
199

    
200
        /* Loss of connection */
201
        NCS_CONNECTION_LOST,                                /**< Connection to server was lost */
202
        /**[03]**/
203

    
204
        NCS_COORD_CONVERT_ERROR,                        /**< NCSGDT coordinate conversion failed */
205

    
206
        /* Metabase Stuff */
207
        NCS_METABASE_OPEN_FAILED,                        /**< Failed to open metabase */
208
        /**[04]**/
209
        NCS_METABASE_GET_FAILED,                        /**< Failed to get value from metabase */
210
        /**[04]**/
211
        NCS_NET_HEADER_SEND_TIMEOUT,                /**< Timeout sending header */
212
        /**[05]**/
213
        
214
        NCS_JNI_ERROR,                                                /**< Java JNI error */
215
        /**[06]**/
216

    
217
        NCS_DB_INVALID_NAME,                                /**< No data source passed */
218
        /**[07]**/
219
        NCS_SYMBOL_COULDNT_RESOLVE_HOST,        /**< Could not resolve address of Image Web Server Symbol Server Extension */
220
        /**[07]**/
221
        
222
        NCS_INVALID_ERROR_ENUM,                                /**< The value of an NCSError error number was invalid! */
223
        /**[08]**/
224
        
225
        /* NCSFileIO errors [10] */
226
        NCS_FILE_EOF,                                                /**< End of file reached */
227
        NCS_FILE_NOT_FOUND,                                        /**< File not found */
228
        NCS_FILE_INVALID,                                        /**< File was invalid or corrupt */
229
        NCS_FILE_SEEK_ERROR,                                /**< Attempted to read, write or seek past file limits */
230
        NCS_FILE_NO_PERMISSIONS,                        /**< Permissions not available to access file */
231
        NCS_FILE_OPEN_ERROR,                                /**< Error opengin file */
232
        NCS_FILE_CLOSE_ERROR,                                /**< Error closing file */
233
        NCS_FILE_IO_ERROR,                                        /**< Miscellaneous error involving file input or output */
234

    
235
        NCS_SET_EXTENTS_ERROR,                                /**< Illegal or invalid world coordinates supplied */
236
        /**[09]**/ 
237

    
238
        NCS_FILE_PROJECTION_MISMATCH,                /**< Image projection does not match that of the controlling layer */
239
        /** 1.65 gdt errors [15]**/
240
        NCS_GDT_UNKNOWN_PROJECTION,                /**< Unknown map projection */
241
        NCS_GDT_UNKNOWN_DATUM,                        /**< Unknown geodetic datum */
242
        NCS_GDT_USER_SERVER_FAILED,                /**< User specified Geographic Projection Database data server failed */
243
        NCS_GDT_REMOTE_PATH_DISABLED,        /**< Remote Geographic Projection Database file downloading has been disabled and no local GDT data is available */
244
        NCS_GDT_BAD_TRANSFORM_MODE,                /**< Invalid mode of transform */
245
        NCS_GDT_TRANSFORM_OUT_OF_BOUNDS,/**< Coordinate to be transformed is out of bounds */
246
        NCS_LAYER_DUPLICATE_LAYER_NAME,        /**< A layer already exists with the specified name */
247
        /**[17]**/
248
        NCS_LAYER_INVALID_PARAMETER,        /**< The specified layer does not contain the specified parameter */
249
        /**[18]**/
250
        NCS_PIPE_CREATE_FAILED,                        /**< Failed to create pipe */
251
        /**[19]**/
252

    
253
        /* Directory creation errors */
254
        NCS_FILE_MKDIR_EXISTS,                        /**< Directory to be created already exists */ /*[20]*/
255
        NCS_FILE_MKDIR_PATH_NOT_FOUND,        /**< The path specified for directory creation does not exist */ /*[20]*/
256
        NCS_ECW_READ_CANCELLED,                        /**< File read was cancelled */
257

    
258
        // Insert new errors before here!
259
        
260
        NCS_MAX_ERROR_NUMBER                        /**< The maximum error value in this enumerated type - should not itself be reported, must always be defined last */ /*[08]*/
261
} NCSError;
262

    
263

    
264
#ifdef NCSERROR_DEFINE_GLOBALS
265

    
266
static char *NCSErrorTextArray[] = {"No Error",                                                        /* NCS_SUCCESS                                                */
267
        /* NCS Raster Errors */
268
        "Queue node creation failed",                                                /* NCS_QUEUE_NODE_CREATE_FAILED                */
269
        "File open failed",                                                                        /* NCS_FILE_OPEN_FAILED                                */
270
        "The Image Web Server's licensed file limit has been reached",                                                                /* NCS_FILE_LIMIT_REACHED                        */
271
        "The requested file is larger than is permitted by the license on this Image Web Server",        /* NCS_FILE_SIZE_LIMIT_REACHED                */
272
        "Not enough memory for new file",                                                                                                                        /* NCS_FILE_NO_MEMORY                                */
273
        "The Image Web Server's licensed client limit has been reached",                                                        /* NCS_CLIENT_LIMIT_REACHED                        */
274
        "Detected duplicate open from net layer",                        /* NCS_DUPLICATE_OPEN                                */
275
        "Packet request type not yet implemented",                        /* NCS_PACKET_REQUEST_NYI                        */
276
        "Packet type is illegal",                                                        /* NCS_PACKET_TYPE_ILLEGAL                        */
277
        "Client closed while requests outstanding",                        /* NCS_DESTROY_CLIENT_DANGLING_REQUESTS */
278

    
279
        /* NCS Network Errors */
280
        "Client UID unknown",                                                                /* NCS_UNKNOWN_CLIENT_UID                        */
281
        "Could not create new client",                                                /* NCS_COULDNT_CREATE_CLIENT                */
282
        "Could not resolve address of Image Web Server",                /* NCS_NET_COULDNT_RESOLVE_HOST                */
283
        "Could not connect to host",                                                        /* NCS_NET_COULDNT_CONNECT                        */
284
        "Receive timeout",                                                                        /* NCS_NET_RECV_TIMEOUT                                */
285
        "Error sending header",                                                                /* NCS_NET_HEADER_SEND_FAILURE                */
286
        "Error receiving header",                                                        /* NCS_NET_HEADER_RECV_FAILURE                */
287
        "Error sending packet",                                                                /* NCS_NET_PACKET_SEND_FAILURE                */
288
        "Error receiving packet",                                                        /* NCS_NET_PACKET_RECV_FAILURE                */
289
        "401 Unauthorised",                                                                        /* NCS_NET_401_UNAUTHORISED                        */
290
        "403 Forbidden",                                                                        /* NCS_NET_403_FORBIDDEN                        */
291
        "Is the host an Image Web Server?",                                        /* NCS_NET_404_NOT_FOUND                        */
292
        "Your HTTP proxy requires authentication",        /*        NCS_NET_407_PROXYAUTH */
293
        "Unexpected HTTP response",                                                        /* NCS_NET_UNEXPECTED_RESPONSE                */
294
        "Bad HTTP response",                                                                /* NCS_NET_BAD_RESPONSE                                */
295
        "Already connected",                                                                /* NCS_NET_ALREADY_CONNECTED                */
296
        "The connection is invalid",                                                /* NCS_INVALID_CONNECTION                        */
297
        "Windows sockets failure",                                                        /* NCS_WINSOCK_FAILURE                                */
298

    
299
        /* NCS Symbol Errors */
300
        "Symbology error",                                                                        /* NCS_SYMBOL_ERROR                                        */
301
        "Could not open database",                                                        /* NCS_OPEN_DB_ERROR                                */
302
        "Could not execute the requested query on database",/* NCS_DB_QUERY_FAILED                                */
303
        "SQL statement could not be executed",                                /* NCS_DB_SQL_ERROR                                        */
304
        "Open symbol layer failed",                                                        /* NCS_GET_LAYER_FAILED                                */
305
        "The database is not open",                                                        /* NCS_DB_NOT_OPEN                                        */
306
        "This type of quad tree is not supported",                        /* NCS_QT_TYPE_UNSUPPORTED                        */
307
        /* Preference errors */
308
        "Invalid local user key name specified",                        /* NCS_PREF_INVALID_USER_KEY                */
309
        "Invalid local machine key name specified",                        /* NCS_PREF_INVALID_MACHINE_KEY                */
310
        "Failed to open registry key",                                                /* NCS_REGKEY_OPENEX_FAILED                        */
311
        "Registry query failed",                                                        /* NCS_REGQUERY_VALUE_FAILED                */
312
        "Type mismatch in registry variable",                                /* NCS_INVALID_REG_TYPE                                */
313
        /* Misc errors */
314
        "Invalid arguments passed to function",                                /* NCS_INVALID_ARGUMENTS                        */
315
        "ECW error",                                                                                /* NCS_ECW_ERROR                                        */
316
        "Server error",                                                                                /* NCS_SERVER_ERROR                                        */
317
        "Unknown error",                                                                        /* NCS_UNKNOWN_ERROR                                */
318
        "Extent conversion failed",                                                        /* NCS_EXTENT_ERROR                                        */
319
        "Could not allocate enough memory",                                        /* NCS_COULDNT_ALLOC_MEMORY        [12]        */
320
        "An invalid parameter was used",                                        /* NCS_INVALID_PARAMETER                        */
321
        /* Compress errors */
322
        "Could not perform Read/Write on file",                                /* NCS_FILEIO_ERROR                                        */
323
        "Could not open compression task",                                        /* NCS_COULDNT_OPEN_COMPRESSION                */
324
        "Could not perform compression",                                        /* NCS_COULDNT_PERFORM_COMPRESSION        */
325
        "Trying to generate too many output lines",                        /* NCS_GENERATED_TOO_MANY_OUTPUT_LINES */
326
        "User cancelled compression",                                                /* NCS_USER_CANCELLED_COMPRESSION        */
327
        "Could not read line from input image file",                /* NCS_COULDNT_READ_INPUT_LINE                */
328
        "Input image size exceeded for this version",                /* NCS_INPUT_SIZE_EXCEEDED                        */
329
                /* Decompression Errors */
330
        "Specified image region is outside image area",                /* NCS_REGION_OUTSIDE_FILE                        */
331
        "Supersampling not supported",                                                /* NCS_NO_SUPERSAMPLE                                */
332
        "Specified image region has a zero width or height",/* NCS_ZERO_SIZE                                        */
333
        "More bands specified than exist in this file",                /* NCS_TOO_MANY_BANDS                                */
334
        "An invalid band number has been specified",                /* NCS_INVALID_BAND_NR                                */
335
        /* New Compression Error */
336
        "Input image size is too small to compress",                /* NCS_INPUT_SIZE_TOO_SMALL                        */
337
        /* NEW Network error */
338
        "The ECWP client version is incompatible with this server", /* NCS_INCOMPATIBLE_PROTOCOL_VERSION */
339
        "Windows Internet Client error",                                        /* NCS_WININET_FAILURE                                */
340
        "Could not load wininet.dll",                                                /* NCS_COULDNT_LOAD_WININET                        */
341

    
342
        /* NCSFile && NCSRenderer class errors */
343
        "Invalid SetView parameters or SetView not called.",/* NCS_FILE_INVALID_SETVIEW */
344
        "There is no open ECW file.",                                                /* NCS_FILE_NOT_OPEN */
345
        
346
        /* NEW JNI Java Errors */
347
        "Class does not implement ECWProgressiveDisplay interface.",/* NCS_JNI_REFRESH_NOT_IMPLEMENTED */
348

    
349
        /* NEW Coordinate Errors */
350
        "Incompatible coordinate systems",                                        /* NCS_INCOMPATIBLE_COORDINATE_SYSTEMS        */
351
        "Incompatible coordinate datum types",                                /* NCS_INCOMPATIBLE_COORDINATE_DATUM        */
352
        "Incompatible coordinate projection types",                        /* NCS_INCOMPATIBLE_COORDINATE_PROJECTION*/
353
        "Incompatible coordinate units types",                                /* NCS_INCOMPATIBLE_COORDINATE_UNITS        */
354
        "Non-linear coordinate systems not supported",                /* NCS_COORDINATE_CANNOT_BE_TRANSFORMED        */
355
        "GDT Error",                                                                                /* NCS_GDT_ERROR */
356
        "Zero length packet",                                                                /* NCS_NET_PACKET_RECV_ZERO_LENGTH */        /**[01]**/
357
        "Must use Japanese version of the ECW SDK",                        /* NCS_UNSUPPORTEDLANGUAGE */                        /**[02]**/
358
        "Loss of connection to server",                                                /* NCS_CONNECTION_LOST */                                /**[03]**/
359
        "NCSGdt coordinate conversion failed",                                /* NCS_COORD_CONVERT_ERROR */
360
        "Failed to open metabase",                                                        /* NCS_METABASE_OPEN_FAILED*/                                /**[04]**/
361
        "Failed to get value from metabase",                                /* NCS_METABASE_GET_FAILED*/                                /**[04]**/
362
        "Timeout sending header",                                                        /* NCS_NET_HEADER_SEND_TIMEOUT*/                        /**[05]**/
363
        "Java JNI error",                                                                        /* NCS_JNI_ERROR */                                                /**[06]**/
364
        "No data source passed",                                                        /* NCS_DB_INVALID_NAME                                */        /**[07]**/
365
        "Could not resolve address of Image Web Server Symbol Server Extension",                /* NCS_SYMBOL_COULDNT_RESOLVE_HOST*/  /**[07]**/
366
        "Invalid NCSError value!",                                                        /* NCS_INVALID_ERROR_ENUM */                        /**[08]**/
367
        /* NCSFileIO errors [10] */
368
        "End Of File reached",                                                                /* NCS_FILE_EOF                                                        [10]        */
369
        "File not found",                                                                        /* NCS_FILE_NOT_FOUND                                        [10]        */
370
        "File is invalid or corrupt",                                                /* NCS_FILE_INVALID                                                [10]        */
371
        "Attempted to read, write or seek past file limits",/* NCS_FILE_SEEK_ERROR                                        [10]        */
372
        "Permissions not available to access file",                        /* NCS_FILE_NO_PERMISSIONS                                [10]        */
373
        "File open error",                                                                        /* NCS_FILE_OPEN_ERROR                                        [10]        */
374
        "File close error",                                                                        /* NCS_FILE_CLOSE_ERROR                                        [10]        */
375
        "File IO error",                                                                        /* NCS_FILE_IO_ERROR                                        [10]        */
376
        
377
        "Illegal World Coordinates",                                                /* NCS_SET_EXTENTS_ERROR                                [13]        */
378

    
379
        "Image projection doesn't match controlling layer", /* NCS_FILE_PROJECTION_MISMATCH                [14]        */
380

    
381
        /** 1.65 gdt errors [15]**/
382
        "Unknown map projection",                                                        /*NCS_GDT_UNKNOWN_PROJECTION,*/
383
        "Unknown datum",                                                                        /*NCS_GDT_UNKNOWN_DATUM,*/
384
        "User specified Geographic Projection Database data server failed",        /*NCS_GDT_USER_SERVER_FAILED*/
385
        "Remote Geographic Projection Database file downloading has been disable and no Geographic Projection Database data is locally available",        /*NCS_GDT_REMOTE_PATH_DISABLED*/
386
        "Invalid transform mode",                                                        /*NCS_GDT_BAD_TRANSFORM_MODE,*/
387

    
388
        "coordinate to be transformed is out of bounds",        /*NCS_GDT_TRANSFORM_OUT_OF_BOUNDS*/
389

    
390
        "Layer already exists with this layer name",                /*NCS_LAYER_DUPLICATE_LAYER_NAME*/        /**[17]**/
391
        "Layer does not contain this parameter",                        /*NCS_LAYER_INVALID_PARAMETER*/                /**[18]**/
392

    
393
        "Failed to create pipe",                                                        /*NCS_PIPE_CREATE_FAILED*/ /**[19]**/
394

    
395
        /* Directory creation errors */
396
        "Directory already exists",                                                        /*[20] NCS_FILE_MKDIR_EXISTS, Directory already exists */
397
        "The path was not found",                                                        /*[20] NCS_FILE_MKDIR_PATH_NOT_FOUND, The path for the location of the new dir does not exist */
398

    
399
        "The read was cancelled",
400
        // Insert new errors before here!
401
        "Max NCSError enum value!",                                                        /* NCS_MAX_ERROR_NUMBER */                                /**[08]**/
402
        ""};
403

    
404
static char *NCSErrorTextArrayEx[] = {
405
        "No error",                                                                                                /* NCS_SUCCESS                                                                                        */
406
        /* NCS Raster Errors */
407
        "Queue node creation failed",                                                        /* NCS_QUEUE_NODE_CREATE_FAILED                                                        */
408
        "Could not open file \"%s\" %s",                                                /* NCS_FILE_OPEN_FAILED                                                                        */
409
        "The Image Web Server's licensed file limit has been reached %s",                                                        /* NCS_FILE_LIMIT_REACHED (license name eg office) */
410
        "The requested file is larger than is permitted by the license on this Image Web Server %s",/* NCS_FILE_SIZE_LIMIT_REACHED (license name eg office)        */
411
        "Not enough memory for new file",                                                                                                                        /* NCS_FILE_NO_MEMORY                                */
412
        "The Image Web Server's licensed client limit has been reached %s",                                                        /* NCS_CLIENT_LIMIT_REACHED        (license name eg enterprise) */
413
        "Detected duplicate open from net layer",                                /* NCS_DUPLICATE_OPEN                                                                        */
414
        "Packet request type not yet implemented %d",                        /* NCS_PACKET_REQUEST_NYI (packet type num)                                */
415
        "Packet type is illegal %d",                                                        /* NCS_PACKET_TYPE_ILLEGAL (packet type num)                        */
416
        "Client closed while requests outstanding",                                /* NCS_DESTROY_CLIENT_DANGLING_REQUESTS                                        */
417

    
418
        /* NCS Network Errors */
419
        "Client UID unknown",                                                                        /* NCS_UNKNOWN_CLIENT_UID                                                                */
420
        "Could not create new client %s",                                                /* NCS_COULDNT_CREATE_CLIENT (reason)                                        */
421
        "Could not resolve address of Image Web Server %s",                /* NCS_NET_COULDNT_RESOLVE_HOST        (ip or hostname)                */
422
        "Could not connect to host %s",                                                        /* NCS_NET_COULDNT_CONNECT (reason)                                                */
423
        "Receive timeout",                                                                                /* NCS_NET_RECV_TIMEOUT                                                                        */
424
        "Error sending header %s",                                                                /* NCS_NET_HEADER_SEND_FAILURE (reason)                                        */
425
        "Error receiving header %s",                                                        /* NCS_NET_HEADER_RECV_FAILURE (reason)                                        */
426
        "Error sending packet",                                                                        /* NCS_NET_PACKET_SEND_FAILURE                                                        */
427
        "Error receiving packet",                                                                /* NCS_NET_PACKET_RECV_FAILURE                                                        */
428
        "401 Unauthorised",                                                                                /* NCS_NET_401_UNAUTHORISED                                                                */
429
        "403 Forbidden",                                                                                /* NCS_NET_403_FORBIDDEN                                                                */
430
        "Is the host an Image Web Server?",                                                /* NCS_NET_404_NOT_FOUND                                                                */
431
        "Your HTTP proxy requires authentication,\nthis is presently unsupported by the Image Web Server control",        /*        NCS_NET_407_PROXYAUTH */
432
        "Unexpected HTTP response %s",                                                                /* NCS_NET_UNEXPECTED_RESPONSE (resonse # or string)*/
433
        "Bad HTTP response %s",                                                                        /* NCS_NET_BAD_RESPONSE        (resonse # or string)                        */
434
        "Already connected",                                                                        /* NCS_NET_ALREADY_CONNECTED                                                        */
435
        "The connection is invalid",                                                        /* NCS_INVALID_CONNECTION                                                                */
436
        "Windows sockets failure %s",                                                        /* NCS_WINSOCK_FAILURE (reason (GetLastError()) or wininet version)        */
437

    
438
        /* NCS Symbol Errors */
439
        "Symbology error",                                                                                /* NCS_SYMBOL_ERROR                                                                                */
440
        "Could not open database",                                                                /* NCS_OPEN_DB_ERROR                                                                        */
441
        "Could not execute the requested query on database",        /* NCS_DB_QUERY_FAILED                                                                        */
442
        "SQL statement could not be executed",                                        /* NCS_DB_SQL_ERROR                                                                                */
443
        "Open symbol layer failed",                                                                /* NCS_GET_LAYER_FAILED                                                                        */
444
        "The database is not open",                                                                /* NCS_DB_NOT_OPEN                                                                                */
445
        "This type of quad tree is not supported",                                /* NCS_QT_TYPE_UNSUPPORTED                                                                */
446

    
447
        /* Preference errors */
448
        "Invalid local user key name specified %s",                                /* NCS_PREF_INVALID_USER_KEY (key name)                                        */
449
        "Invalid local machine key name specified %s",                        /* NCS_PREF_INVALID_MACHINE_KEY        (local machine key)                */
450
        "Failed to open registry key %s",                                                /* NCS_REGKEY_OPENEX_FAILED        (key name)                                        */
451
        "Registry query failed %s",                                                                /* NCS_REGQUERY_VALUE_FAILED (reason)                                        */
452
        "Type mismatch in registry variable",                                        /* NCS_INVALID_REG_TYPE                                                                        */
453
        
454
        /* Misc errors */
455
        "Invalid arguments passed to function %s",                                /* NCS_INVALID_ARGUMENTS (function name)                                */
456
        "ECW error %s",                                                                                        /* NCS_ECW_ERROR (reason)                                                                */
457
        "Server error %s",                                                                                /* NCS_SERVER_ERROR (reason)                                                        */
458
        "Unknown error %s",                                                                                /* NCS_UNKNOWN_ERROR (reason)                                                        */
459
        "Extent conversion failed",                                                                /* NCS_EXTENT_ERROR                                                                                */
460
        "Could not allocate enough memory %s",                                        /* NCS_COULDNT_ALLOC_MEMORY        (what trying to malloc)        [12]*/
461
        "An invalid parameter was used %s",                                                /* NCS_INVALID_PARAMETER (reason)                                                */
462
        
463
        /* Compress errors */
464
        "Could not perform Read/Write on file %s",                                /* NCS_FILEIO_ERROR        (filename)                                                        */
465
        "Could not open compression task %s",                                        /* NCS_COULDNT_OPEN_COMPRESSION        (reason)                                */
466
        "Could not perform compression %s",                                                /* NCS_COULDNT_PERFORM_COMPRESSION        (reason)                        */
467
        "Trying to generate too many output lines",                                /* NCS_GENERATED_TOO_MANY_OUTPUT_LINES                                        */
468
        "User cancelled compression",                                                        /* NCS_USER_CANCELLED_COMPRESSION                                                */
469
        "Could not read line from input image file",                        /* NCS_COULDNT_READ_INPUT_LINE                                                        */
470
        "Input image size exceeded for this version",                        /* NCS_INPUT_SIZE_EXCEEDED                                                                */
471
        
472
        /* Decompression Errors */
473
        "Specified image region is outside image area",                        /* NCS_REGION_OUTSIDE_FILE                                                                */
474
        "Supersampling not supported",                                                        /* NCS_NO_SUPERSAMPLE                                                                        */
475
        "Specified image region has a zero width or height",        /* NCS_ZERO_SIZE                                                                                */
476
        "More bands specified than exist (%d) in this file (%d)",/* NCS_TOO_MANY_BANDS        (bands passed, bands in file)        */
477
        "An invalid band number has been specified %s",                        /* NCS_INVALID_BAND_NR (bandnr)                                                        */
478
        
479
        /* New Compression Error */
480
        "Input image size is too small to compress",                        /* NCS_INPUT_SIZE_TOO_SMALL                                                                */
481
        /* NEW Network error */
482
        "The ECWP client version (%s) is incompatible with this server (%s)", /* NCS_INCOMPATIBLE_PROTOCOL_VERSION (clientver, server ver) */
483
        "Windows Internet Client error %s",                                                /* NCS_WININET_FAILURE        (reason)                                                */
484
        "Could not load wininet.dll %s",                                                /* NCS_COULDNT_LOAD_WININET        (reason)                                        */
485

    
486
        /* NCSFile && NCSRenderer class errors */
487
        "Invalid SetView parameters or SetView not called.",        /* NCS_FILE_INVALID_SETVIEW                                                                */
488
        "There is no open ECW file.",                                                        /* NCS_FILE_NOT_OPEN                                                                        */
489
        
490
        /* NEW JNI Java Errors */
491
        "Class does not implement ECWProgressiveDisplay interface.",/* NCS_JNI_REFRESH_NOT_IMPLEMENTED */
492

    
493
        /* NEW Coordinate Errors */
494
        "Incompatible coordinate systems",                                                /* NCS_INCOMPATIBLE_COORDINATE_SYSTEMS                                        */
495
        "Incompatible coordinate datum types",                                        /* NCS_INCOMPATIBLE_COORDINATE_DATUM                                        */
496
        "Incompatible coordinate projection types",                                /* NCS_INCOMPATIBLE_COORDINATE_PROJECTION                                */
497
        "Incompatible coordinate units types",                                        /* NCS_INCOMPATIBLE_COORDINATE_UNITS                                        */
498
        "Non-linear coordinate systems not supported",                        /* NCS_COORDINATE_CANNOT_BE_TRANSFORMED                                        */
499
        "GDT Error : %s",                                                                                /* NCS_GDT_ERROR (reason)                                                                */
500
        "Zero length packet : %s",                                                                /* NCS_NET_PACKET_RECV_ZERO_LENGTH (reason)             */ /**[01]**/
501
        "Must use Japanese version of the ECW SDK",                                /* NCS_UNSUPPORTEDLANGUAGE                                                                */ /**[02]**/
502
        "Lost of connection to server : %s",                                        /* NCS_CONNECTION_LOST                                                                        */ /**[03]**/
503
        "NCSGdt coordinate conversion failed : %s",                                /* NCS_COORD_CONVERT_ERROR */
504
        "Failed to open metabase : %s",                                                        /* NCS_METABASE_OPEN_FAILED*/                                /**[04]**/
505
        "Failed to get value from metabase : %s",                                /* NCS_METABASE_GET_FAILED*/                                /**[04]**/
506
        "Timeout sending header : %s",                                                        /* NCS_NET_HEADER_SEND_TIMEOUT*/                        /**[05]**/
507
        "Java JNI error : %s",                                                                        /* NCS_JNI_ERROR */                                                /**[06]**/
508
        "No data source passed",                                                                /* NCS_DB_INVALID_NAME                                                                        */
509
        "Could not resolve address of Image Web Server Symbol Server Extension",                /* NCS_SYMBOL_COULDNT_RESOLVE_HOST                */
510
        "Invalid NCSError value!",                                                        /* NCS_INVALID_ERROR_ENUM */                        /**[08]**/
511
        /* NCSFileIO errors [10] */
512
        "End Of File reached : %s",                                                                        /* NCS_FILE_EOF                                        [10]        */
513
        "File not found : %s",                                                                                /* NCS_FILE_NOT_FOUND                        [10]        */
514
        "File is invalid or corrupt : %s",                                                        /* NCS_FILE_INVALID                                [10]        */
515
        "Attempted to read, write or seek past file limits : %s",        /* NCS_FILE_SEEK_ERROR                        [10]        */
516
        "Permissions not available to access file : %s",                        /* NCS_FILE_NO_PERMISSIONS                [10]        */
517
        "File open error : %s",                                                                                /* NCS_FILE_OPEN_ERROR                        [10]        */
518
        "File close error : %s",                                                                        /* NCS_FILE_CLOSE_ERROR                        [10]        */
519
        "File IO error : %s",                                                                                /* NCS_FILE_IO_ERROR                        [10]        */
520
        
521
        "Illegal World Coordinates : %s",                                                        /* NCS_SET_EXTENTS_ERROR                [13]        */
522

    
523
        "Image projection doesn't match controlling layer : %s",        /* NCS_FILE_PROJECTION_MISMATCH                [14]        */
524

    
525
        /** 1.65 gdt errors [15]**/
526
        "Unknown map projection: %s",                                                        /*NCS_GDT_UNKNOWN_PROJECTION,*/
527
        "Unknown datum: %s",                                                                        /*NCS_GDT_UNKNOWN_DATUM,*/
528
        "User specified Geographic Projection Database data server failed while loading %s.  Please check your network connection and if the problem persists contact the website administrator.",                        /*NCS_GDT_USER_SERVER_FAILED*/
529
        "Remote Geographic Projection Database file downloading has been disable and no Geographic Projection Database data is locally available",        /*NCS_GDT_REMOTE_PATH_DISABLED*/
530
        "Invalid transform mode: %s",                                                        /*NCS_GDT_BAD_TRANSFORM_MODE,                        [17]**/
531

    
532
        "coordinate to be transformed is out of bounds: %s",        /*NCS_GDT_TRANSFORM_OUT_OF_BOUNDS*/
533

    
534
        "Layer already exists with this name : %s",                                /*NCS_LAYER_DUPLICATE_LAYER_NAME*/        /**[17]**/
535
        "Layer does not contain this parameter : %s",                        /*NCS_LAYER_INVALID_PARAMETER*/                /**[18]**/
536

    
537
        "Failed to create pipe : %s",                                                        /*NCS_PIPE_CREATE_FAILED*/ /**[19]**/
538

    
539
        /* Directory creation errors */
540
        "Directory already exists : %s",                                                /*[20] NCS_FILE_MKDIR_EXISTS, Directory already exists */
541
        "The path was not found : %s",                                                        /*[20] NCS_FILE_MKDIR_PATH_NOT_FOUND, The path for the location of the new dir does not exist */
542

    
543
        "The read was cancelled",
544
        // Insert new errors before here!
545
        "Max NCSError enum value!",                                                        /* NCS_MAX_ERROR_NUMBER */                                /**[08]**/
546
        ""};
547

    
548
#endif /* NCSERROR_DEFINE_GLOBALS */
549

    
550
/** 
551
 *        @def Macro for checking success status on error return values
552
 */
553
#define NCS_SUCCEEDED(nError) (nError == NCS_SUCCESS)
554
/** 
555
 *        @def Macro for checking fail status on error return values
556
 */
557
#define NCS_FAILED(nError) (nError != NCS_SUCCESS)
558

    
559
void NCSErrorInit(void);
560
void NCSErrorFini(void);
561

    
562
/** 
563
 *        Construct a message box displaying the error test for the last reported error
564
 *        @param                nError                The error
565
 *        @param                pWindow                The parent window of the message box
566
 */
567
void NCSGetLastErrorTextMsgBox(NCSError nError, void *pWindow);
568
/**
569
 *        Return formatted error text for a series of errors
570
 *        @param                nError                Variable length list of error arguments
571
 *        @return                                        (char *) value, formatted error text
572
 */
573
const char * NCSFormatErrorText(NCSError nError, ...);
574
/**
575
 *        Return error text for the last error 
576
 *        @param                nError                Error number
577
 *        @return                                        (char *) value, error text
578
 */
579
const char * NCSGetLastErrorText(NCSError nError);
580
/**        
581
 *        Get the error number of the last error that has occurred
582
 *        @return                                        NCSError value, the last error number
583
 */
584
NCSError NCSGetLastErrorNum(void);
585

    
586
#ifdef WIN32 // [11]
587

    
588
DWORD NCSDbgGetExceptionInfoMsg(EXCEPTION_POINTERS *pExceptionPtr, char *pMessage);
589

    
590
#endif        /* MACINTOSH */
591

    
592
// Deprecated
593
extern const char * NCSGetErrorText(NCSError eError);
594

    
595
#ifdef WIN32
596
#ifdef _WIN32_WCE
597
#define MSGBOX_WARNING_FLAGS        (MB_OK|MB_ICONINFORMATION)
598
#define MSGBOX_ERROR_FLAGS                (MB_OK|MB_ICONERROR)
599
#else
600
#define MSGBOX_WARNING_FLAGS        (MB_OK|MB_ICONINFORMATION|MB_TASKMODAL)
601
#define MSGBOX_ERROR_FLAGS                (MB_OK|MB_ICONERROR|MB_TASKMODAL)
602
#endif
603
#elif defined PALM
604
NCSError NCSPalmGetNCSError(Err eErr);
605
#endif
606

    
607
#ifdef __cplusplus
608
}
609
#endif
610

    
611
#endif /* NCSERRORS_H */