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 : Thursday, August 4, 2005 12:14:56 PM(UTC)

rmajew  
rmajew

Groups: Registered
Posts: 2


I'm trying to use the API from within PowerBuilder and I'm having problems with HTWAINSESSION.  Every time I try and use it in a function I get -13 return.  According to the help file HTWAINSESSION is a HANDLE and PowerBuilder declares a handle as an UnsignedLong.  I create a variable of type UnsignedLong and try and pass it by reference to L_TwainInitSession or any other function that takes that type and I get the -13 return.

Is there anything special about HTWAINSESSION?  What am I doing wrong?

 

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 : Tuesday, August 9, 2005 2:13:38 PM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

The problem is probably caused by the second parameter, which is of
type APPLICATIONDATA. If you don't pass a valid structure (also by
reference) in the parameter, the function fails. Here's a correct way to do it in C++:

HTWAINSESSION hSession;
APPLICATIONDATA AppData;
AppData.hWnd = hWnd;
strcpy (AppData.szManufacturerName, "LEAD Technologies, Inc.");
strcpy (AppData.szAppProductFamily, "LEAD Test Applications");
strcpy (AppData.szVersionInfo, "Version 1.0");
strcpy (AppData.szAppName, "TWAIN Test Application");
AppData.uStructSize = sizeof(AppData);

nRet = L_TwainInitSession(&hSession, &AppData);

Note, in the current version of LEADTOOLS, sizeof(AppData) is 808 bytes.

Amin Dodin

LEADTOOLS Technical Support
Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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.054 seconds.