Forums › TWAIN Classic › Scanning directly into a file › Reply To: Scanning directly into a file
I succeed in setting up the capability via:
TwCapability cap2 = new TwCapability(TwCap.IXferMech, (short) TwXferMech.FILE);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap2);
rc returns success.
I still get a failure later on in
rc = DSsetupFileXfer(appid, srcds, TwDG.Control, TwDAT.SetupFileXfer, TwMSG.Set, twsfFile);
Where DSsetupFileXfer is:
[DllImport(“twain_32.dll”, EntryPoint = “#1”)]
private static extern TwRC DSsetupFileXfer([In, Out] TwIdentity origin, [In] TwIdentity dest, TwDG dg, TwDAT dat, TwMSG msg, TwSetupFileXfers sfxfr);
I have setup TwSetupFileXfers as follows:
internal class TwSetupFileXfers
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=256)]
public Byte[] FileName = new Byte[256]; /* File to contain data */
public UInt16 Format; /* A TWFF_xxxx constant */
public IntPtr VrefNum; /* Used for Macintosh only */
}
How do I get an error message back?