Forum Replies Created
What is the error or problem that you have having with MSG_XFERREADY?
Are you using callback?
Do you receive the message?
The TWAIN2 DSM is Licensed as GNU Library or Lesser General Public License (LGPL) not GPL.
LGPL was chosen to allow application and driver developers the freedom to link to the TWAIN 2 DSM.
Check the TWAIN2 log file to make sure the DSM received it.
If it did not check to see if you have more than one copy of the twain_32.dll.
You might have one in Windows and one in your system folder. I have encountered some bad drivers that would install twain_32.dll to the system folder.
I do understand what you are talking about.
There is a Thunking layer in Windows 32bit twain_32.dll that allows 32bit Apps to communicate with 16bit DS.
This was before my time and I don’t know of the consequences of having this layer. How long did it take driver developers to embrace 32bit?
I have not heard of complaints from scanner vendors. There are currently very few 64bit TWAIN Applications. We do want those drives re-written and updated to TWAIN 2.x any way. And at that point it is pretty easy to also pump out a 64bit version. Scanner vendors that want to support WIA on 64bit must provide a 64bit WIA driver. WIA driver is required to pass WinQual.
So scanner vendors should build their 32 & 64 bit TWAIN 2.x drivers then use WIA-on-TWAIN to obtain WIA drivers and the world is a better place.
Apple went though a similar problem when they went to OSX. Application and DS had to be rewritten.
It is possible to add a Thunking layer to the TWAIN2 DSM. In fact it is an open source and anyone can submit a patch. 🙂
This is from the 9.1 twain.h header file. There is a bit more info in there on thunking as well.
SDH – 03/23/95 – WATCH
The thunker requires knowledge about size of data being passed in the lpData parameter to DS_Entry (which is not readily available due to type LPVOID. Thus, we key off the DAT_ argument to determine the size. This has a couple implications:
1) Any additional DAT_ features require modifications to the thunk code for thunker support.
2) Any applications which use the custom capabilities are not supported under thunking since we have no way of knowing what size data (if any) is being passed.
If this is a real issue, then people should speak up.
Yes. 64bit TWAIN Applications only work with the 64bit DSM and the 64bit DSM only sees 64bit Data Sources.
Jim WattersApril 13, 2010 at 1:01 pm in reply to: Opening the DSM in a console application:"reading viola #25242
Two things you can do to track down what is happening:
Enabling the DSM log file can help.
Get the Condition Code after a failure.
memset(&status, 0, sizeof(TW_STATUS));
TW_UINT16 twrc = _DSM_Entry( &m_MyInfo, _pdestID, DG_CONTROL, DAT_STATUS, MSG_GET, (TW_MEMREF)&status);
Jim WattersApril 12, 2010 at 1:35 pm in reply to: Opening the DSM in a console application:"reading viola #25240
The last parameter for MSG_OPENDSM on Windows is a pointer to a windows handle.
TW_UINT16 returnCode = _DSM_Entry(&appIdentity, NULL, DG_CONTROL, DAT_PARENT, MSG_OPENDSM, (TW_MEMREF)&parentWindow);
From the TWAIN 2.1 Spec 10-139 ICAP_IMAGEFILEFORMAT, the following file formats are defined:
TWFF_TIFF, TWFF_PICT, TWFF_BMP, TWFF_XBM, TWFF_JFIF, TWFF_FPX, TWFF_TIFFMULTI, TWFF_PNG, TWFF_SPIFF, TWFF_EXIF, TWFF_PDF, TWFF_JP2, TWFF_DEJAVU, and TWFF_PDFA
The sample Software-only DS supports TIFF and BMP
see function CTWAINDS_Base::saveImageFile()
Not sure about the Canon scanner directly. but in general I would do it this way.
Set the caps in this order.
XFERMECH (file or memory)
If scanning without UI set PixelType, BitDepth, ( if using file – ImageFileformat ), Compression, (if jpeg – JPEGQuality ).
If scanning with UI then set the compression of all possible PixelType and BitDepth combinations. Example:
BW, 1bit – G4
Gray, 8bit – JPEG
RGB, 24bit – JPEG
Make sure you do a get ImageInfo for each transfer to know what compression is being used. Memory transfer with compression is a bit more complicated. Width X Height X BitDepth != memory required. If AutomaticBorderDection is turned on you might not even know Width and Height until the transfer is complete.
Jim WattersMarch 4, 2010 at 2:30 pm in reply to: TWAIN Sample Data Source and Application causing Blue Screen #25178
I don’t have Windows Server 2003 Terminal Server.
Can you post a TWAIN DSM log file
If I understand correctly you are always returning -1 as XferCount to indicate that there is more images coming regardless if there is more paper in the scanner. The scanner has a stop button to finish the scan job.
Then return TWRC_CANCEL to the DAT_IMAGExxxXFER message to indicate the user canceled.
The source remains in state 7. It is up to the application to send PendingXfer MSG_RESET
If the UI was visible and you want the application to close the UI too then you should send MSG_CLOSEDSREQ.
Applications like Photoshop will keep the UI open so the user can press scan to start the next batch.
If you have more images to transfer you should stay in state 6 and return a count of -1 or >0.
Traversing from state 6 to 5 happens if you send a count of 0 for DAT_PENDINGXFERS.
Either by transferring all images or after receiving DAT_PENDINGXFERS/MSG_RESET which stops the transfers and sets the count to 0.
The source only sends one MSG_XFERREADY at the beginning of each scan loop.
You need to include twain.h
There is no UNICODE version of GetProcAddress.
The following is from a non-UNICODE build.
//load the TWAIN source manager DLL
HMODULE hDSM = LoadLibrary("TWAIN_32.DLL");
//get the address of the TWAIN entry procedure
DSMENTRYPROC pDSMEntry = (DSMENTRYPROC)GetProcAddress(hDSM, "DSM_Entry");
The TWAIN2 Sample Application displays the ExtImageInfo including barcode strings from the scanner.
It will either retrieve all advertised ExtImageInfo or if the DS does not support ICAP_SUPPORTEDEXTIMAGEINFO it will attempt a small set of known types that includes TWEI_BARCODETEXT.
JFL Peripheral Solutions Inc.
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************February 12, 2010 at 6:36 pm in reply to: Kodak Scanner Emulation – Problems with images from disk #25028
Does anyone know how to use simulation mode on the i1120? Or where I can get help?
I am trying to use the i1120 in simulation mode.
In const.ini I have set
But when I try to scan I get a no paper warning.
There was no sample ramscan.txt file installed for the i1120 , I tried coping the i30 and modifying it but no go.
; i1120 Inquiry (i1120)...