home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / delphi / kompon / d5 / SGSCAN.ZIP / eztwain.h < prev    next >
C/C++ Source or Header  |  1998-07-14  |  21KB  |  459 lines

  1. // EZTWAIN.H - interface to Easy TWAIN library
  2. //
  3. // EZTWAIN is not a product, and is not the work of any company involved
  4. // in promoting or using the TWAIN standard.  This code is sample code,
  5. // provided without charge, and you use it entirely at your own risk.
  6. // No rights or ownership is claimed by the author, or by any company
  7. // or organization.  There are no restrictions on use or (re)distribution.
  8. //
  9. // 0.0    05/11/94    created
  10. // 1.0a    06/23/94    first alpha version
  11. // 1.04 05/03/95    added: WriteNativeToFile, WriteNativeToFilename,
  12. //                    FreeNative, SetHideUI, GetHideUI, SetCurrentUnits,
  13. //                    GetCurrentUnits, SetCurrentResolution, SetBitDepth,
  14. //                    SetCurrentPixelType, SetCapOneValue.
  15. // 1.05 11/06/96    32-bit conversion
  16. // 1.06 08/21/97        correction to message hook, fixed 32-bit exports
  17.  
  18. #ifndef EZTWAIN_H
  19. #define EZTWAIN_H
  20.  
  21. #ifndef _WINDOWS_
  22. #include "windows.h"
  23. #endif
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {            /* Assume C declarations for C++ */
  27. #endif    /* __cplusplus */
  28.  
  29. /*#ifndef EZTAPI
  30.   #ifdef _WIN32
  31.      #define EZTAPI WINAPI
  32.   #else
  33.      #define EZTAPI FAR PASCAL
  34.   #endif
  35. #endif replace with below -- dsn */
  36. #ifndef EZTAPI
  37.   #ifdef _WIN32
  38.      #define EZTAPI _stdcall
  39.   #else
  40.      #define EZTAPI FAR PASCAL
  41.   #endif
  42. #endif
  43.  
  44. //--------- Basic calls
  45.  
  46. HANDLE EZTAPI TWAIN_AcquireNative(HWND hwndApp, unsigned wPixTypes);
  47. // The minimal use of EZTWAIN.DLL is to just call this routine, with 0 for
  48. // both params.  EZTWAIN creates a window if hwndApp is 0.
  49. //
  50. // Acquires a single image, from the currently selected Data Source, using
  51. // Native-mode transfer. It waits until the source closes (if it's modal) or
  52. // forces the source closed if not.  The return value is a handle to the
  53. // acquired image.  Only one image can be acquired per call.
  54. //
  55. // Under Windows, the return value is a global memory handle - applying
  56. // GlobalLock to it will return a (huge) pointer to the DIB, which
  57. // starts with a BITMAPINFOHEADER.
  58. // NOTE: You are responsible for disposing of the returned DIB - these things
  59. // can eat up your Windows memory fast!  See TWAIN_FreeNative below.
  60. //
  61. // The image type can be restricted using the following masks.  A mask of 0
  62. // means 'any pixel type is welcome'.
  63. // Caution: You should not assume that the source will honor a pixel type
  64. // restriction!  If you care, check the parameters of the DIB.
  65.  
  66. #define TWAIN_BW        0x0001    // 1-bit per pixel, B&W     (== TWPT_BW)
  67. #define TWAIN_GRAY        0x0002    // 1,4, or 8-bit grayscale  (== TWPT_GRAY)
  68. #define TWAIN_RGB        0x0004    // 24-bit RGB color         (== TWPT_RGB)
  69. #define TWAIN_PALETTE    0x0008    // 1,4, or 8-bit palette    (== TWPT_PALETTE)
  70. #define TWAIN_ANYTYPE    0x0000    // any of the above
  71.  
  72. void EZTAPI TWAIN_FreeNative(HANDLE hdib);
  73. // Release the memory allocated to a native format image, as returned by
  74. // TWAIN_AcquireNative. (If you are coding in C or C++, this is just a call
  75. // to GlobalFree.)
  76. // If you use TWAIN_AcquireNative and don't free the returned image handle,
  77. // it stays around taking up Windows (virtual) memory until your application
  78. // terminates.  Memory required per square inch:
  79. //             1 bit B&W       8-bit grayscale     24-bit color
  80. // 100 dpi      1.25KB              10KB               30KB
  81. // 200 dpi        5KB               40KB              120KB
  82. // 300 dpi      11.25KB             90KB              270KB
  83. // 400 dpi       20KB              160KB              480KB
  84. //
  85.  
  86. int EZTAPI TWAIN_AcquireToClipboard(HWND hwndApp, unsigned wPixTypes);
  87. // Like AcquireNative, but puts the resulting image, if any, into the system
  88. // clipboard.  Under Windows, this will put a CF_DIB item in the clipboard
  89. // if successful.  If this call fails, the clipboard is either empty or
  90. // contains the old contents.
  91. // A return value of 1 indicates success, 0 indicates failure.
  92. //
  93. // Useful for environments like Visual Basic where it is hard to make direct
  94. // use of a DIB handle.  In fact, TWAIN_AcquireToClipboard uses
  95. // TWAIN_AcquireNative for all the hard work.
  96.  
  97. int EZTAPI TWAIN_AcquireToFilename(HWND hwndApp, char *pszFile);
  98. // Acquire an image and write it to a .BMP (Windows Bitmap) file.
  99. // The file name and path in pszFile are used.  If pszFile is NULL or
  100. // points to an empty string, the user is prompted with a Save File dialog.
  101. // Return values:
  102. // -1 means the Acquire failed.
  103. //  0 means the Save failed (or was cancelled)
  104. //  1 indicates success.
  105.  
  106. int EZTAPI TWAIN_SelectImageSource(HWND hwnd);
  107. // This is the routine to call when the user chooses the "Select Source..."
  108. // menu command from your application's File menu.  Your app has one of
  109. // these, right?  The TWAIN spec calls for this feature to be available in
  110. // your user interface, preferably as described.
  111. // Note: If only one TWAIN device is installed on a system, it is selected
  112. // automatically, so there is no need for the user to do Select Source.
  113. // You should not require your users to do Select Source before Acquire.
  114. //
  115. // This function posts the Source Manager's Select Source dialog box.
  116. // It returns after the user either OK's or CANCEL's that dialog.
  117. // A return of 1 indicates OK, 0 indicates one of the following:
  118. //   a) The user cancelled the dialog
  119. //   b) The Source Manager found no data sources installed
  120. //   c) There was a failure before the Select Source dialog could be posted
  121. // -- details --
  122. // Only sources that can return images (that are in the DG_IMAGE group) are
  123. // displayed.  The current default source will be highlighted initially.
  124. // In the standard implementation of "Select Source...", your application
  125. // doesn't need to do anything except make this one call.
  126. //
  127. // If you want to be meticulous, disable your "Acquire" and "Select Source"
  128. // menu items or buttons if TWAIN_IsAvailable() returns 0 - see below.
  129.  
  130.  
  131. //--------- Basic TWAIN Inquiries
  132.  
  133. int EZTAPI TWAIN_IsAvailable(void);
  134. // Call this function any time to find out if TWAIN is installed on the
  135. // system.  It takes a little time on the first call, after that it's fast,
  136. // just testing a flag.  It returns 1 if the TWAIN Source Manager is
  137. // installed & can be loaded, 0 otherwise. 
  138.  
  139.  
  140. int EZTAPI TWAIN_EasyVersion(void);
  141. // Returns the version number of EZTWAIN.DLL, multiplied by 100.
  142. // So e.g. version 2.01 will return 201 from this call.
  143.  
  144. int EZTAPI TWAIN_State(void);
  145. // Returns the TWAIN Protocol State per the spec.
  146. #define TWAIN_PRESESSION        1    // source manager not loaded
  147. #define TWAIN_SM_LOADED            2    // source manager loaded
  148. #define TWAIN_SM_OPEN            3    // source manager open
  149. #define TWAIN_SOURCE_OPEN        4    // source open but not enabled
  150. #define TWAIN_SOURCE_ENABLED    5    // source enabled to acquire
  151. #define TWAIN_TRANSFER_READY    6    // image ready to transfer
  152. #define TWAIN_TRANSFERRING        7    // image in transit
  153.  
  154. //--------- Callback mechanism -------------
  155. // Added by DSN 7/98, this allows the user to specify an
  156. // optional callback function to be called each time a new image comes
  157. // in.  This can be a potentially powerful way to increase the primary
  158. // application's efficiency, because upon receipt of an hdib the app
  159. // could start a background thread to begin processing the images as
  160. // needed.  Why bother with this?  Because on my Pentium 150, the Windows
  161. // NT task monitor indicates that when I download images at 112kbps that
  162. // I'm only using 15% of the processor's power, and the remaining 85% of
  163. // the time it is idle!  It's silly to wait to begin processing because
  164. // there's so much untapped processing capacity here.
  165.  
  166. typedef void (EZTAPI *HDIBCALLBACKPROC)(HANDLE, int);
  167. void EZTAPI TWAIN_RegisterCallback(HDIBCALLBACKPROC *fxn);
  168. void EZTAPI TWAIN_UnRegisterCallback();
  169.  
  170. //--------- DIB handling utilities ---------
  171. // The next three functions were added by DSN 7/98
  172. // They are used to clear the list of hDibs as well as provide
  173. // access to the total number of images scanned and access any
  174. // particular image's hDib.
  175.  
  176. void EZTAPI TWAIN_ClearDibList(void);
  177. int EZTAPI TWAIN_GetNumDibs();
  178. HANDLE EZTAPI TWAIN_GetDib(int n);
  179.  
  180. int EZTAPI TWAIN_DibDepth(HANDLE hdib);
  181. // Depth of DIB, in bits i.e. bits per pixel.
  182. int EZTAPI TWAIN_DibWidth(HANDLE hdib);
  183. // Width of DIB, in pixels (columns)
  184. int EZTAPI TWAIN_DibHeight(HANDLE hdib);
  185. // Height of DIB, in lines (rows)
  186. int EZTAPI TWAIN_DibNumColors(HANDLE hdib);
  187. // Number of colors in color table of DIB
  188.  
  189. HPALETTE EZTAPI TWAIN_CreateDibPalette(HANDLE hdib);
  190. // Create and return a logical palette to be used for drawing the DIB.
  191. // For 1, 4, and 8-bit DIBs the palette contains the DIB color table.
  192. // For 24-bit DIBs, a default halftone palette is returned.
  193.  
  194. void EZTAPI TWAIN_DrawDibToDC(
  195.         HDC hDC,        // destination device context
  196.         int dx, int dy,    // destination (x,y)
  197.         int w, int h,    // width and height
  198.         HANDLE hdib,    // DIB handle
  199.         int sx, int sy    // source (x,y) in DIB
  200.         );
  201. // Draws a DIB on a device context.
  202. // You should call CreateDibPalette, select that palette
  203. // into the DC, and do a RealizePalette(hDC) first.
  204.  
  205. //--------- BMP file utilities
  206.  
  207. int EZTAPI TWAIN_WriteNativeToFilename(HANDLE hdib, LPCSTR pszFile);
  208. // Writes a DIB handle to a .BMP file
  209. //
  210. // hdib        = DIB handle, as returned by TWAIN_AcquireNative
  211. // pszFile    = far pointer to NUL-terminated filename
  212. // If pszFile is NULL or points to a null string, prompts the user
  213. // for the filename with a standard file-save dialog.
  214. //
  215. // Return values:
  216. //     0    success
  217. //    -1    user cancelled File Save dialog
  218. //    -2    file open error (invalid path or name, or access denied)
  219. //    -3    (weird) unable to lock DIB - probably an invalid handle.
  220. //    -4    writing BMP data failed, possibly output device is full
  221.  
  222. int EZTAPI TWAIN_WriteNativeToFile(HANDLE hdib, HFILE fh);
  223. // Writes a DIB to a file in .BMP format.
  224. //
  225. // hdib        = DIB handle, as returned by TWAIN_AcquireNative
  226. // fh        = file handle, as returned by _open, _lopen or OpenFile
  227. //
  228. // Return value as for TWAIN_WriteNativeToFilename
  229.  
  230. HANDLE EZTAPI TWAIN_LoadNativeFromFilename(LPCSTR pszFile);
  231. // Load a .BMP file and return a DIB handle (as from AcquireNative.)
  232. // Accepts a filename (including path & extension).
  233. // If pszFile is NULL or points to a null string, the user is prompted.
  234. // Returns a DIB handle if successful, otherwise NULL.
  235.  
  236. HANDLE EZTAPI TWAIN_LoadNativeFromFile(HFILE fh);
  237. // Like LoadNativeFromFilename, but takes an already open file handle.
  238.  
  239. //--------- Application Registration
  240.  
  241. void EZTAPI TWAIN_RegisterApp(    // record application information
  242.     int        nMajorNum, int nMinorNum,    // major and incremental revision of application. E.g.
  243.                                         // for version 2.1, nMajorNum == 2 and nMinorNum == 1
  244.     int        nLanguage,                    // language of this version (use TWLG_xxx from TWAIN.H)
  245.     int        nCountry,                    // country of this version (use TWCY_xxx from TWAIN.H)
  246.     LPSTR    lpszVersion,                // version info string e.g. "1.0b3 Beta release"
  247.     LPSTR    lpszMfg,                    // name of manufacturer/developer e.g. "Crazbat Software"
  248.     LPSTR    lpszFamily,                    // product family e.g. "BitStomper"
  249.     LPSTR    lpszProduct);                // specific product e.g. "BitStomper Deluxe Pro"
  250. //
  251. // TWAIN_RegisterApp can be called *AS THE FIRST CALL*, to register the
  252. // application. If this function is not called, the application is given a
  253. // 'generic' registration by EZTWAIN.
  254. // Registration only provides this information to the Source Manager and any
  255. // sources you may open - it is used for debugging, and (frankly) by some
  256. // sources to give special treatment to certain applications.
  257.  
  258. //--------- Lower-level functions for greater control of the TWAIN protocol --------
  259.  
  260. void EZTAPI TWAIN_SetHideUI(int fHide);
  261. int EZTAPI TWAIN_GetHideUI(void);
  262. // These functions control the 'hide source user interface' flag.
  263. // This flag is cleared initially, but if you set it non-zero, then when
  264. // a source is enabled it will be asked to hide its user interface.
  265. // Note that this is only a request - some sources will ignore it!
  266. // This affects AcquireNative, AcquireToClipboard, and EnableSource.
  267. // If the user interface is hidden, you will probably want to set at least
  268. // some of the basic acquisition parameters yourself - see
  269. // SetCurrentUnits, SetBitDepth, SetCurrentPixelType and
  270. // SetCurrentResolution below.
  271.  
  272. unsigned EZTAPI TWAIN_GetResultCode(void);
  273. // Return the result code (TWRC_xxx) from the last triplet sent to TWAIN
  274.  
  275. unsigned EZTAPI TWAIN_GetConditionCode(void);
  276. // Return the condition code from the last triplet sent to TWAIN.
  277. // (To be precise, from the last call to TWAIN_DS below)
  278. // If a source is NOT open, return the condition code of the source manager.
  279.  
  280. int EZTAPI TWAIN_LoadSourceManager(void);
  281. // Finds and loads the Data Source Manager, TWAIN.DLL.
  282. // If Source Manager is already loaded, does nothing and returns TRUE.
  283. // This can fail if TWAIN.DLL is not installed (in the right place), or
  284. // if the library cannot load for some reason (insufficient memory?) or
  285. // if TWAIN.DLL has been corrupted.
  286.  
  287. int EZTAPI TWAIN_OpenSourceManager(HWND hwnd);
  288. // Opens the Data Source Manager, if not already open.
  289. // If the Source Manager is already open, does nothing and returns TRUE.
  290. // This call will fail if the Source Manager is not loaded.
  291.  
  292. int EZTAPI TWAIN_OpenDefaultSource(void);
  293. // This opens the source selected in the Select Source dialog.
  294. // If a source is already open, does nothing and returns TRUE.
  295. // Fails if the source manager is not loaded and open.
  296.  
  297. int EZTAPI TWAIN_EnableSource(HWND hwnd);
  298. // Enables the open Data Source. This posts the source's user interface
  299. // and allows image acquisition to begin.  If the source is already enabled,
  300. // this call does nothing and returns TRUE.
  301.  
  302. int EZTAPI TWAIN_DisableSource(void);
  303. // Disables the open Data Source, if any.
  304. // This closes the source's user interface.
  305. // If there is not an enabled source, does nothing and returns TRUE.
  306.  
  307. int EZTAPI TWAIN_CloseSource(void);
  308. // Closes the open Data Source, if any.
  309. // If the source is enabled, disables it first.
  310. // If there is not an open source, does nothing and returns TRUE.
  311.  
  312. int EZTAPI TWAIN_CloseSourceManager(HWND hwnd);
  313. // Closes the Data Source Manager, if it is open.
  314. // If a source is open, disables and closes it as needed.
  315. // If the Source Manager is not open, does nothing and returns TRUE.
  316.  
  317. int EZTAPI TWAIN_UnloadSourceManager(void);
  318. // Unloads the Data Source Manager i.e. TWAIN.DLL - releasing
  319. // any associated memory or resources.
  320. // This call will fail if the Source Manager is open, otherwise
  321. // it always succeeds and returns TRUE.
  322.  
  323.  
  324. int EZTAPI TWAIN_MessageHook(LPMSG lpmsg);
  325. // This function detects Windows messages that should be routed
  326. // to an enabled Data Source, and picks them off.  In a full TWAIN
  327. // app, TWAIN_MessageHook is called inside the main GetMessage loop.
  328. // The skeleton code looks like this:  
  329. //        MSG msg;
  330. //      while (GetMessage((LPMSG)&msg, NULL, 0, 0)) {
  331. //            if (!TWAIN_MessageHook ((LPMSG)&msg)) {
  332. //                TranslateMessage ((LPMSG)&msg);
  333. //                DispatchMessage ((LPMSG)&msg);
  334. //            }
  335. //        } // while
  336.  
  337.  
  338. void EZTAPI TWAIN_ModalEventLoop(void);
  339. // Process messages until termination, source disable, or image transfer.
  340. //
  341. // Executes exactly the sample code given above for TWAIN_MessageHook, but
  342. // terminates as soon as the source is disabled or a transfer completes.
  343. // This function is called by TWAIN_AcquireNative.
  344.  
  345. void EZTAPI TWAIN_NativeXferGetAll(LPMSG pmsg);
  346. // above functions added by DSN 7/98.  They are based on Spike's code in
  347. // CTWAIN.  They allow for acquisition of multiple images.  The use of
  348. // TWAIN_NativeXferGetAll replaces the use of TWAIN_NativeXferReady
  349. // (prototype not here, but rather in eztwain.c for some reason).
  350.  
  351. int EZTAPI TWAIN_AbortAllPendingXfers(void);
  352.  
  353. int EZTAPI TWAIN_WriteDibToFile(LPBITMAPINFOHEADER lpDIB, HFILE fh);
  354. // Writes a DIB to a file in .BMP format.
  355. // Returns TRUE if successful, FALSE otherwise.
  356. // (Likely causes of failure: device full, or permission denied to write to file or device
  357. // lpDIB    = pointer to DIB, as from GlobalLock of DIB handle
  358. // fh        = file handle, as returned by C _open or Windows _lopen or OpenFile
  359. // For example of use, see TWAIN_WriteNativeToFilename in EZTWAIN.C
  360.  
  361. int EZTAPI TWAIN_NegotiateXferCount(int nXfers);
  362. // Negotiate with open Source the number of images application will accept.
  363. // This is only allowed in State 4 (TWAIN_SOURCE_OPEN)
  364. // nXfers = -1 means any number
  365.  
  366. int EZTAPI TWAIN_NegotiatePixelTypes(unsigned wPixTypes);
  367. // Negotiate with the source to restrict pixel types that can be acquired.
  368. // This tries to restrict the source to a *set* of pixel types,
  369. // See TWAIN_AcquireNative above for some mask constants.
  370. // --> This is only allowed in State 4 (TWAIN_SOURCE_OPEN)
  371. // A parameter of 0 (TWAIN_ANYTYPE) causes no negotiation & no restriction.
  372. // You should not assume that the source will honor your restrictions, even
  373. // if this call succeeds!
  374.  
  375. int EZTAPI TWAIN_GetCurrentUnits(void);
  376. // Ask the source what its current unit of measure is.
  377. // If anything goes wrong, this function just returns TWUN_INCHES (0).
  378.  
  379. int EZTAPI TWAIN_SetCurrentUnits(int nUnits);
  380. // Set the current unit of measure for the source.
  381. // Unit of measure codes are in TWAIN.H, but TWUN_INCHES is 0.
  382.  
  383. int EZTAPI TWAIN_GetBitDepth(void);
  384. // Get the current bitdepth, which can depend on the current PixelType.
  385. // Bit depth is per color channel e.g. 24-bit RGB has bit depth 8.
  386. // If anything goes wrong, this function returns 0.
  387.  
  388. int EZTAPI TWAIN_SetBitDepth(int nBits);
  389. // (Try to) set the current bitdepth (for the current pixel type).
  390.  
  391. int EZTAPI TWAIN_GetPixelType(void);
  392. // Ask the source for the current pixel type.
  393. // If anything goes wrong (it shouldn't), this function returns 0 (TWPT_BW).
  394.  
  395. int EZTAPI TWAIN_SetCurrentPixelType(int nPixType);
  396. // (Try to) set the current pixel type for acquisition.
  397. // This is only allowed in State 4 (TWAIN_SOURCE_OPEN)
  398. // The source may select this pixel type, but don't assume it will.
  399.  
  400. /*double EZTAPI TWAIN_GetCurrentResolution(void);
  401. // Ask the source for the current resolution.
  402. // Resolution is in dots per current unit! (See TWAIN_GetCurrentUnits above)
  403. // If anything goes wrong (it shouldn't) this function returns 0.0
  404.  
  405. int EZTAPI TWAIN_SetCurrentResolution(double dRes);
  406. // (Try to) set the current resolution for acquisition.
  407. // Resolution is in dots per current unit! (See TWAIN_GetCurrentUnits above)
  408. // This is only allowed in State 4 (TWAIN_SOURCE_OPEN)
  409. // Note: The source may select this resolution, but don't assume it will.
  410. */
  411.  
  412. //--------- Low-level capability negotiation functions --------
  413.  
  414. // Setting a capability is valid only in State 4 (TWAIN_SOURCE_OPEN)
  415. // Getting a capability is valid in State 4 or any higher state.
  416.  
  417. int EZTAPI TWAIN_SetCapOneValue(unsigned Cap,
  418.                                            unsigned ItemType,
  419.                                            long ItemVal);
  420. // Do a DAT_CAPABILITY/MSG_SET, on capability 'Cap' (e.g. ICAP_PIXELTYPE,
  421. // CAP_AUTOFEED, etc.) using a TW_ONEVALUE container with the given item type
  422. // and value.  Obviously, the item value must fit into 32 bits.
  423. // Returns TRUE (1) if successful, FALSE (0) otherwise.
  424.  
  425. int EZTAPI TWAIN_GetCapCurrent(unsigned Cap,
  426.                                           unsigned ItemType,
  427.                                           void FAR *pVal);
  428. // Do a DAT_CAPABILITY/MSG_GETCURRENT on capability 'Cap'.
  429. // Copy the current value out of the returned container into *pVal.
  430. // If the operation fails (the source refuses the request), or if the
  431. // container is not a ONEVALUE or ENUMERATION, or if the item type of the
  432. // returned container is incompatible with the expected TWTY_ type in nType,
  433. // returns FALSE.  If this function returns FALSE, *pVal is not touched.
  434.  
  435. //--------- Lowest-level functions for TWAIN protocol --------
  436.  
  437.  
  438. int EZTAPI TWAIN_DS(unsigned long DG, unsigned DAT, unsigned MSG, void FAR *pData);
  439. // Passes the triplet (DG, DAT, MSG, pData) to the open data source if any.
  440. // Returns 1 (TRUE) if the result code is TWRC_SUCCESS, 0 (FALSE) otherwise.
  441. // The last result code can be retrieved with TWAIN_GetResultCode(), and the corresponding
  442. // condition code can be retrieved with TWAIN_GetConditionCode().
  443. // If no source is open this call will fail, result code TWRC_FAILURE, condition code TWCC_NODS.
  444.  
  445. int EZTAPI TWAIN_Mgr(unsigned long DG, unsigned DAT, unsigned MSG, void FAR *pData);
  446. // Passes a triplet to the Data Source Manager (DSM).
  447. // Returns 1 (TRUE) if the result code is TWRC_SUCCESS, 0 (FALSE) otherwise.
  448. // The last result code can be retrieved with TWAIN_GetResultCode(), and the corresponding
  449. // condition code can be retrieved with TWAIN_GetConditionCode().
  450. // If the Source Manager is not open, this call will fail, and set the result code to TWRC_FAILURE,
  451. // with a condition code of TWCC_SEQERROR (triplet out of sequence).
  452.  
  453.  
  454. #ifdef __cplusplus
  455. }
  456. #endif
  457.  
  458. #endif
  459.