Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, November 27, 2011 11:21:58 AM(UTC)
markaarnold

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)
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, November 28, 2011 7:57:28 AM(UTC)

Daoud  
Daoud

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.

 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.053 seconds.