LEADTOOLS Support
Imaging
Imaging SDK Questions
Invalid parameter passed calling twainStartup in WPF
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, November 27, 2011 11:21:58 AM(UTC)
Groups: Registered
Posts: 4
I'm getting the "invalid parameter passed" error when calling twain Startup in a WPF app.
I've observed the following:
I believe I see more of these when calling twainStartup from the MainWindow_Loaded handler
I tried moving the call to twain Startup to the MainWindow constructor below InitializeComponent(). I don't get the error, but during scanning I get nasty corrupted memory errors.
Is the MainWindow_Loaded handler not the correct place? I feel the problem lies in the window handle I'm passing here:
string strFriendlyName = AppDomain.CurrentDomain.FriendlyName;
System.Diagnostics.Process[] pro = System.Diagnostics.Process.GetProcessesByName(strFriendlyName.Substring(0, strFriendlyName.LastIndexOf('.')));
WindowWrapper winParent = new WindowWrapper(pro[0].MainWindowHandle);
m_LTtwainSession.Startup(winParent, "", "", "", "", TwainStartupFlags.None);
(sorry for the crummy code formatting - I'm not sure how to post code in the forums and my attachments are dropped)
#2
Posted
:
Monday, November 28, 2011 7:57:28 AM(UTC)
Groups: Registered
Posts: 256
The following forum post (at the end of the thread) contains sample projects for using our Twain features in a WPF application:
http://support.leadtools.com/SupportPortal/CS/forums/38413/ShowPost.aspx#38413
Please check the demo and see if it works for you. If it does, try to modify your code to become similar to the demo.
If you face a problem with the demo on our forums, send us the details of the problem.
LEADTOOLS Support
Imaging
Imaging SDK Questions
Invalid parameter passed calling twainStartup in WPF
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.