This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, August 4, 2005 12:14:56 PM(UTC)
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?
#2
Posted
:
Tuesday, August 9, 2005 2:13:38 PM(UTC)
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 LEAD Logo](https://www.leadtools.com/images/new-site-images/leadtools-logo-header.png)
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.