Home › Forums › TWAIN Classic › Missing source in select source dialog
- This topic has 1 reply, 1 voice, and was last updated 8 years, 11 months ago by PascalGula.
- AuthorPosts
Hello,
I am developing a Twain Application and face the following issue: when I try to get the available source with USERSELECT or GETFIRST, I have an empty list or end of list.
If I am using Twack 32 or Twain Inspector, I am able to see the source installed on my computer.I am building my application use the specification 2.3, the source I should use is however compliant with specification 1.9, but I suppose that there is a backward compatibility.
I saw in the FAQ that data structure should be aligned on 16 bit, so I configured my visual studio project with /Zp2 flag.
What I also see is that the select source dialog is not using the same UI button with Twack, but I suppose that Twack has redefined its UI…
Lastly, I defined my AppIdentity as follow:
memset(&AppIdentity, 0, sizeof(AppIdentity));AppIdentity.Id = 0; // init to 0, but Source Manager will assign real value
AppIdentity.Version.MajorNum = 1;
AppIdentity.Version.MinorNum = 0;
AppIdentity.Version.Language = TWLG_ENGLISH;
AppIdentity.Version.Country = TWCY_GERMANY;
AppIdentity.ProtocolMajor = TWON_PROTOCOLMAJOR;
AppIdentity.ProtocolMinor = TWON_PROTOCOLMINOR;
AppIdentity.SupportedGroups = DF_APP2 | DG_IMAGE | DG_CONTROL;strncpy_s(AppIdentity.Version.Info, “1.0.0”, sizeof(AppIdentity.Version.Info));
strncpy_s(AppIdentity.Manufacturer, “dots GmbH Berlin”, sizeof(AppIdentity.Manufacturer));
strncpy_s(AppIdentity.ProductFamily, “dots Scanning Module”, sizeof(AppIdentity.ProductFamily));
strncpy_s(AppIdentity.ProductName, “dots Scanning Module”, sizeof(AppIdentity.ProductName));Thanks,
PascalHi,
we found the solution to the problem, and I think it is interesting to share it in case someone stumble upon the same issue…
The things is that another part of our application needed to add some directory into the search Dll path, leading to a call SetDllDirectory which modify subtlely the search Dll algorithm (suppress the search in current folder).
The implementation of the Twain Driver we tried to interface used this current folder search feature, so we add to save the added folder, come back to the original algorithm by calling SetDllDirector(NULL), and back to modified one after the scan process…Hipe this helped!
Cheers,
Pascal- AuthorPosts